ui
ui copied to clipboard
react-hook-form Form component error
- error src/components/ui/form.tsx (46:10) @ getFieldState
- error TypeError: Cannot destructure property 'getFieldState' of '(0 , react_hook_form__WEBPACK_IMPORTED_MODULE_4__.useFormContext)(...)' as it is null.
at useFormField (./src/components/ui/form.tsx:49:13)
at eval (./src/components/ui/form.tsx:88:35)
44 | const fieldContext = React.useContext(FormFieldContext)
45 | const itemContext = React.useContext(FormItemContext)
> 46 | const { getFieldState, formState } = useFormContext()
| ^
47 |
48 | const fieldState = getFieldState(fieldContext.name, formState)
49 |
Duplicate of #623.