Replies: 2 comments 2 replies
-
what do u mean validation becomes incorrect? |
Beta Was this translation helpful? Give feedback.
-
i think i know what @rachelrj means, because i might be experiencing the same. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am building a form that has a nested form that conditionally appears.
I am wondering whether to use
useForm
oruseFormContext
for the nested form.If using
useFormContext
is there a way to send the default values for the nested fields back up to the parent form?Or do the default values need to be on the inputs themselves.
I've tried using both
useForm
anduseFormContext
and when the conditional inputs unmount or remount the validation becomes incorrect.I am using
useController
for each input and settingshouldUnregister
to be true for the nested fields. (So, I am not explicitly registering each field)Beta Was this translation helpful? Give feedback.
All reactions