react-hook-form / devtools

📋 DevTools to help debug forms.
https://react-hook-form.com/dev-tools
MIT License
646 stars 47 forks source link

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

Open michaelperrin opened 1 year ago

michaelperrin commented 1 year ago

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

Expected result

Thor-Herman commented 1 year ago

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