Replies: 1 comment 1 reply
-
Rely on a whole reference object as change dependency on I'm not sure what is the reason why you expect same reference object for
|
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Hey, the
getValues
doc says:An optimized helper for reading form values. The difference between watch and
getValues
is thatgetValues
will not trigger re-renders or subscribe to input changes.Despite this,
getValues
returns a new object on every render, thususeEffect
hook that depends onconst formValues = getValues()
is being triggered on every render. How can I solve this behavior?Here's an example on codesandbox: https://codesandbox.io/s/react-hook-form-v7-getvalues-forked-ktq67y?file=/src/index.jsx
Beta Was this translation helpful? Give feedback.
All reactions