Finally! I've sought out ideas on complex react hook form structures for real world use that are not "My First To Do List" tutorials. Could have used this a while back. Well done.
I do the same thing. I make sure each form element or section emits data the same way so the parent form just catches the event with the data and maps it to some object to send to some endpoint. The only problem I have had with this approach is that nested objects of data or arrays can get tricky. You might have multiple endpoints to update different parts of the form - there are of course ways around this but it can get weird.
Finally! I've sought out ideas on complex react hook form structures for real world use that are not "My First To Do List" tutorials. Could have used this a while back. Well done.
You separated each form section in a different component, I have never build a form this way before 🎉. Thanks for this
I do the same thing. I make sure each form element or section emits data the same way so the parent form just catches the event with the data and maps it to some object to send to some endpoint.
The only problem I have had with this approach is that nested objects of data or arrays can get tricky. You might have multiple endpoints to update different parts of the form - there are of course ways around this but it can get weird.
This is exactly what I'm looking for, thanks!.
Is there any way to bind single error to single input instead of handling error at section level?