Unclear docs on form.watch callback variant #9357
Unanswered
bryanhaney-shipengine
asked this question in
General
Replies: 1 comment
-
Did you miss the example code below? https://react-hook-form.com/api/useform/watch send us a PR if you have better suggestion to improve on it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
It took some head scratching and source diving to figure out why the callback variant of
form.watch(() => { ... })
was getting called increasingly more times on every field change. The docs are not clear that the callback variant sets up a new subscription per call, and thus it belongs in a useEffect.Beta Was this translation helpful? Give feedback.
All reactions