react-hook-form / devtools

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

devtool prevent field in values prop from registering #197

Open QzCurious opened 1 year ago

QzCurious commented 1 year ago

Version Number

react-hook-form: 7.43.9 react: 18.2.0

Codesandbox/Expo snack

https://codesandbox.io/s/hookform-devtools-bug-devtool-prevent-field-in-values-prop-from-registering-minvzb?file=/src/App.tsx

Steps to reproduce

I have two video clip to demonstrate. Both two demo had devtool on.

By useForm({ defaultValues: { str } }). It works as expect.

https://user-images.githubusercontent.com/38932402/229013340-0d389873-ae62-4922-91fd-e97e5d417d12.mp4

By useForm({ values: { str } }). I use a useEffect to trigger the update behavior of values. The field seems not to be registered as the "value" show above the input is never updated.

https://user-images.githubusercontent.com/38932402/229014523-8c7695e4-65b5-4b66-8774-c5dbb812f1ef.mp4