Open QzCurious opened 1 year ago
react-hook-form: 7.43.9 react: 18.2.0
https://codesandbox.io/s/hookform-devtools-bug-devtool-prevent-field-in-values-prop-from-registering-minvzb?file=/src/App.tsx
I have two video clip to demonstrate. Both two demo had devtool on.
useForm({ defaultValues: { str } })
https://user-images.githubusercontent.com/38932402/229013340-0d389873-ae62-4922-91fd-e97e5d417d12.mp4
useForm({ values: { str } })
useEffect
values
https://user-images.githubusercontent.com/38932402/229014523-8c7695e4-65b5-4b66-8774-c5dbb812f1ef.mp4
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 auseEffect
to trigger the update behavior ofvalues
. 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