You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The error I'm getting in the console is Uncaught ReferenceError: useFormContext is not defined. This error is from the Input.jsx file.
This rule came right from the react-hook-form documentation, You need to wrap your form with the [FormProvider](https://react-hook-form.com/docs/formprovider) component for useFormContext to work properly.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have two components in my react app, Form component and Input component
The Input component is rendered in the Form component and I am using react-hook-form to validate the Input compoment, like so:
The error I'm getting in the console is
Uncaught ReferenceError: useFormContext is not defined
. This error is from theInput.jsx
file.This rule came right from the
react-hook-form
documentation,You need to wrap your form with the [FormProvider](https://react-hook-form.com/docs/formprovider) component for useFormContext to work properly.
Am I doing anything wrong here???
Beta Was this translation helpful? Give feedback.
All reactions