react-hook-form / devtools

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

React hook form + DevTool + reset causes from to not register fields correctly #173

Open phyolim opened 2 years ago

phyolim commented 2 years ago

Version Number

7.34.2

Codesandbox/Expo snack

https://stackblitz.com/edit/react-hook-form-set-form-values-in-useeffect-m65nbe?file=package.json,App.jsx

Steps to reproduce

  1. Go to the sandbox
  2. Form doesn't get filled in with initial values

It works if devtools is removed from the component. It also works if form version is downgraded to 7.15.

It used to work fine on version 7.15. I didn't try other versions to find out which one broke it. I'm also not sure if it's a bug on @hookform/devtools or on react-hook-form.

Expected behaviour

Form gets reset to async values and fields register correctly. Dev tools display fields with values.

What browsers are you seeing the problem on?

Chrome

Relevant log output

No response

Code of Conduct