-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Description
When DevTools are enabled, re-initializing fields by resetting them only work the second time.
I created a Code sandbox to reproduce the issue
Steps to reproduce
- Create a form with a field
- Add a console log with a
watch
for that field - Add a reset button that calls React Hook Form's
reset
method - Test your page by filling in data for the field, and click on the reset button : you should see the console log with the reinitialized data for the field, and the field should be reinitialized
- Add DevTools to the page and click the reset button
Result
- The console log is shown only the second time the reset button is clicked
- The field is reset only the second second time the reset button is clicked
- Everything works fine if DevTools are not enabled
Expected result
- The console log should be shown with the reinitialized data
- The field should be reinitialized
Thor-Herman
Metadata
Metadata
Assignees
Labels
No labels