docs: fixes incorrect useField example (#9222)
This commit is contained in:
@@ -21,10 +21,11 @@ To do so, import the `useField` hook as follows:
|
|||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
'use client'
|
'use client'
|
||||||
|
import type { TextFieldClientComponent } from 'payload'
|
||||||
import { useField } from '@payloadcms/ui'
|
import { useField } from '@payloadcms/ui'
|
||||||
|
|
||||||
const CustomTextField: React.FC = () => {
|
export const CustomTextField: TextFieldClientComponent = ({ path }) => {
|
||||||
const { value, setValue, path } = useField() // highlight-line
|
const { value, setValue } = useField({ path }) // highlight-line
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
Reference in New Issue
Block a user