Replies: 3 comments
-
Looking at the source code it seems
The PR in question does have explanation why that change was made #12786 |
Beta Was this translation helpful? Give feedback.
-
I am not sure if this is related but I was able to reproduce issue related to useWatch where it is triggered even though totally unrelated field changes. #12925 |
Beta Was this translation helpful? Give feedback.
-
I believe it's an unintended consequence of a change in 7.55. I've opened a PR to restore the previous behavior: #12945 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We are using react hook form v7.54.2. After updating to v7.59.0 the internal call back in useWatch.ts is triggered 10 times more. I have confirmed this by modifying the useWatch.ts to log when callback is called like this:
I did the similar change in the v7.54.2 branch and the callback is triggered exactly 10 times more in the new version. We have a quite large form and this performance drop is noticable.
The form has quite a bit of logic like:
We are using
useWatch
andrules.deps
to notify different parts of the UI of these changes and we also have lot of nested fields and updates to those fields.I am wondering is this a regression or was the useWatch implementation changed to be a lot more aggressive in order to maybe fix some issues where it was not triggered correctly?
Beta Was this translation helpful? Give feedback.
All reactions