79288593

Date: 2024-12-17 16:13:10
Score: 2.5
Natty:
Report link

From react-hook-form watch docs

When defaultValue is not defined, the first render of watch will return undefined because it is called before register. It's recommended to provide defaultValues at useForm to avoid this behaviour, but you can set the inline defaultValue as the second argument.

Are you providing a defaultValues object to your useForm declaration?

const {watch} = useForm({defaultValues})
Reasons:
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (1):
Posted by: Derek