docs: fixes getPayloadHMR import path (#8180)
This commit is contained in:
committed by
GitHub
parent
c28618b19c
commit
59b6107e2d
@@ -68,7 +68,7 @@ Here's a quick example of a React Server Component fetching data using the Local
|
|||||||
```tsx
|
```tsx
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import config from '@payload-config'
|
import config from '@payload-config'
|
||||||
import { getPayloadHMR } from '@payloadcms/next'
|
import { getPayloadHMR } from '@payloadcms/next/utilities'
|
||||||
|
|
||||||
const MyServerComponent: React.FC = () => {
|
const MyServerComponent: React.FC = () => {
|
||||||
// If you're working in Next.js, and you want HMR,
|
// If you're working in Next.js, and you want HMR,
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ Then, render the `RefreshRouteOnSave` component anywhere in your `page.tsx`. Her
|
|||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
import { RefreshRouteOnSave } from './RefreshRouteOnSave.tsx'
|
import { RefreshRouteOnSave } from './RefreshRouteOnSave.tsx'
|
||||||
import { getPayloadHMR } from '@payloadcms/next'
|
import { getPayloadHMR } from '@payloadcms/next/utilities'
|
||||||
import config from '../payload.config'
|
import config from '../payload.config'
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ See the [Collections](https://payloadcms.com/docs/configuration/collections) doc
|
|||||||
|
|
||||||
```ts
|
```ts
|
||||||
import { headers as getHeaders } from 'next/headers.js'
|
import { headers as getHeaders } from 'next/headers.js'
|
||||||
import { getPayloadHMR } from '@payloadcms/next'
|
import { getPayloadHMR } from '@payloadcms/next/utilities'
|
||||||
import config from '../../payload.config'
|
import config from '../../payload.config'
|
||||||
|
|
||||||
export default async function AccountPage({ searchParams }) {
|
export default async function AccountPage({ searchParams }) {
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ Then, render `RefreshRouteOnSave` anywhere in your `page.tsx`. Here's an example
|
|||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
import { RefreshRouteOnSave } from './RefreshRouteOnSave.tsx'
|
import { RefreshRouteOnSave } from './RefreshRouteOnSave.tsx'
|
||||||
import { getPayloadHMR } from '@payloadcms/next'
|
import { getPayloadHMR } from '@payloadcms/next/utilities'
|
||||||
import config from '../payload.config'
|
import config from '../payload.config'
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
|
|||||||
Reference in New Issue
Block a user