--

I think the best feature of react-hook-form is field-level validation with `rules` prop. It puts validation logic where it belongs, makes it easy to read, and allows you to add/remove fields without breaking things. I see the appeal of having a top-level payload type, but I think it should be defined at the handler level that processes the payload, and not at the form component level. Form composition makes life easier IMO

--

--

Ismayil Khayredinov
Ismayil Khayredinov

Written by Ismayil Khayredinov

Software engineer who combines optimism with pessimism to build robust and idiot-proof solutions

No responses yet