How I approach complex forms in React (react-hook-form)

Поділитися
Вставка
  • Опубліковано 23 гру 2024

КОМЕНТАРІ • 4

  • @krismadison8607
    @krismadison8607 Рік тому +4

    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.

  • @animedelights
    @animedelights Рік тому +4

    You separated each form section in a different component, I have never build a form this way before 🎉. Thanks for this

  • @greggsworld4453
    @greggsworld4453 11 місяців тому +1

    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.

  • @manuelbosi9022
    @manuelbosi9022 Рік тому +1

    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?