Skip to content
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

When DevTools are enabled, resetting form works only on the second time #200

Open
michaelperrin opened this issue Aug 22, 2023 · 1 comment

Comments

@michaelperrin
Copy link

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

  1. Create a form with a field
  2. Add a console log with a watch for that field
  3. Add a reset button that calls React Hook Form's reset method
  4. 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
  5. 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
Copy link

Having the same problem here, devtools only work after hot reloading because of reset

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants