issue: setValue
won't set the value to an array on a nested input
#11964
Labels
setValue
won't set the value to an array on a nested input
#11964
Version Number
7.51.5
Codesandbox/Expo snack
https://codesandbox.io/p/sandbox/react-hook-form-v7-ts-setvalue-forked-chhp6s?file=%2Fsrc%2Findex.tsx%3A52%2C73
Steps to reproduce
Set Value Of "nested" To {"tags":[2,3]}
buttonNotice the input value was not updated.
Expected behaviour
I was expecting the value to be updated.
Indeed, it works for non-array values (such as
2
), and also works when callingsetValue
on the exact path ("nested.tags"
instead of the root path `"nested").I saw nothing in the docs that indicates this is not supported, only that the input needs to be registered before doing so but this is the case here.
Thank you so much.
What browsers are you seeing the problem on?
Chrome
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: