Replies: 1 comment
-
A solution was provided on stackoverflow. Adding |
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.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a form (codesandbox here) with 2 components:
My default form data looks like this:
My initial idea was to have a single textfield, and just change its registered name based on the language selected.
I was expecting react-hook-form to update the correct prop in the form object - i.e.: if I select
es-ES
and enter a text, it should update thees-ES
prop - , but that isn't happening. If you play with the codesandbox, you'll notice that while the field name is being updated correctly when the language is changed, its value is "out of sync" with the form data, like it's not pulling the correct value from the state.Hence my question: is this the expected behaviour of this library? If so, how would you approach this UI instead?
Beta Was this translation helpful? Give feedback.
All reactions