ui icon indicating copy to clipboard operation
ui copied to clipboard

react-hook-form Form component error

Open dukeofsoftware opened this issue 1 year ago • 1 comments

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

dukeofsoftware avatar Jun 23 '23 10:06 dukeofsoftware

Duplicate of #623.

dan5py avatar Jun 23 '23 11:06 dan5py