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
Describe the bug
calling reset with keepDefaultValues clears default values (with useController).
To Reproduce
Steps to reproduce the behavior:
Create form with an input created with useController. Default value can be provided on the useForm level or inline.
Call reset({}, { keepDefaultValues: true })
The value passed to the input gets set to undefined. a watch on the field value does not change.
Codesandbox link (Required)
Include a codesandbox will help us to investigate the issue quicker.
V7
JS CSB
You can reproduce in this sandbox by hitting the reset button. The value updated log statement shows the value passed to the input ref, the field updated statement shows the form's value.
Expected behavior
input value and form value should match. This does not impact the value passed to submit. Just keeps showing the annoying react error warning message.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Don't think it matters, but here's mine:
OS: [macOS (Big Sur)]
Browser [Chrome]
Version [Version 91.0.4472.106 (Official Build) (x86_64)] Additional context
Not a real issue as far as I can tell, but those react error messages are polluting my logs and make it difficult to debug.
The text was updated successfully, but these errors were encountered:
Describe the bug
calling reset with keepDefaultValues clears default values (with useController).
To Reproduce
Steps to reproduce the behavior:
Codesandbox link (Required)
Include a codesandbox will help us to investigate the issue quicker.
V7
You can reproduce in this sandbox by hitting the reset button. The value updated log statement shows the value passed to the input ref, the field updated statement shows the form's value.
Expected behavior
input value and form value should match. This does not impact the value passed to submit. Just keeps showing the annoying react error warning message.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Don't think it matters, but here's mine:
Additional context
Not a real issue as far as I can tell, but those react error messages are polluting my logs and make it difficult to debug.
The text was updated successfully, but these errors were encountered: