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 text was updated successfully, but these errors were encountered:
martin-wahlberg
changed the title
issue: useWatch returntype is not partial when getting single fields.
issue: useWatch returntype is not partial when getting specific fields.
Feb 17, 2023
We are moving away from DeepPartial in the next major, this is something that gives us so many issues as such. I would recommend you provide the correct type for your form values.
Isn't it correct that form-elements could have a undefined value until they are set?
Your data type should be partial in the first place, we are moving away DeepPartail in the next major version, and async defaultValues is already not supported by deep partial.
Version Number
7.43.1
Codesandbox/Expo snack
https://codesandbox.io/s/react-typescript-forked-rlj5bx?file=/src/App.tsx
Steps to reproduce
Expected behaviour
Typescript should tell me that the fields are possibly undefined.
I guess i am expecting something like
here:
https://github.com/react-hook-form/react-hook-form/blob/master/src/useWatch.ts#L77
and here
https://github.com/react-hook-form/react-hook-form/blob/master/src/useWatch.ts#L110
What browsers are you seeing the problem on?
No response
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: