docs: fixes incorrect useField example (#9222)

This commit is contained in:
Jarrod Flesch
2024-11-15 10:01:52 -05:00
committed by GitHub
parent 82e72fa7f2
commit 2801c41d91

View File

@@ -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>