-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
watch() called with an array returns the defaultValues for falsy values #251
Comments
This is the expected behavior. The example you share they have the same output.
|
I'm sorry I didn't make it clear enough. In the example, when you input empty string and checkbox off,
|
thanks, I have patched the bug: you can test out in this beta version: |
|
Thanks we will release the patch soon. |
* close issue on #251 * remove comments * add unit test for isSameError
the patch has been released, please close this issue if works fine :) |
When
watch()
is called with an array of field names, it returns the defaultValues for fields their values are empty string orfalse
. It should returns empty values, not default values.This behavior doesn't occurs when
watch()
is called with single field name or no arguments.Here is an example code.
https://codesandbox.io/s/react-hook-form-watch-defaultvalues-ucp22
The text was updated successfully, but these errors were encountered: