Problem for use resolvers with twice useFieldArray #7784
Unanswered
julio3266
asked this question in
Show and tell
Replies: 0 comments
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.
-
i have a form using react hook form, in this form contains the following structure: Rooms -> Guests -> forms for each guest, using useFieldArray for generating two arrays, one for rooms and other for guests.
estructure of Array:

Code of Parent Component (Rooms):

Code of Child Component(Form for each guest):

The problem is that as I have an array structure and the form is rendered in the second useFieldArray, it would be necessary to insert the validation to be controlled from the second component(Child), if I set the resolvers using the useForm of the first component(rooms) , it will set the same validation for all inputs regardless of array
Beta Was this translation helpful? Give feedback.
All reactions