Potential Bug: setValue does not always work for unregistered inputs #6104
joniaiuser
started this conversation in
RFC
Replies: 1 comment 1 reply
-
Try with the next version |
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
-
I have this piece of code in my app
If I remove the line
register(`loanContractActions.${idx}` as "loanContractActions.0");
There will be instances where after calling
router.replace(router.asPath)
in nextjs, thesetValue
will be unable to set the value of theattachments
array back to an empty array. It will work again after a hard refresh.I have yet to do a repro in code sandbox, as I managed to fix it using
register
. But this is different behaviour from what is suggested in the documentation where register is only 'recommended'.I am using version 7.12.1 react-hook-form and NextJS version 11.0.1
Beta Was this translation helpful? Give feedback.
All reactions