From 2801c41d91c9711a1334ef8542b50cf4bf9e5d1e Mon Sep 17 00:00:00 2001 From: Jarrod Flesch <30633324+JarrodMFlesch@users.noreply.github.com> Date: Fri, 15 Nov 2024 10:01:52 -0500 Subject: [PATCH] docs: fixes incorrect useField example (#9222) --- docs/admin/hooks.mdx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/admin/hooks.mdx b/docs/admin/hooks.mdx index 3b008da70..2886eb85f 100644 --- a/docs/admin/hooks.mdx +++ b/docs/admin/hooks.mdx @@ -21,10 +21,11 @@ To do so, import the `useField` hook as follows: ```tsx 'use client' +import type { TextFieldClientComponent } from 'payload' import { useField } from '@payloadcms/ui' -const CustomTextField: React.FC = () => { - const { value, setValue, path } = useField() // highlight-line +export const CustomTextField: TextFieldClientComponent = ({ path }) => { + const { value, setValue } = useField({ path }) // highlight-line return (