r/reactjs • u/Last_Distribution_84 • Dec 17 '23
Discussion Is react hook form overhyped?
I created a custom form validation hook.Its a simple hook and I felt I didn't needed react hook forms for just simple form validation. For simpe validation writing that much code and loading the whole library felt not right. Maybe I am wrong.
0
Upvotes
1
u/svish Dec 18 '23
But you're also manually setting up a custom resolver for every form, adjusting the schema manually, and like with
superRefinesplitting up the validation into separate pieces in different places.With Yup the whole definition of what a valid form submission is can be stored in a single place, and with our form wrapper component we don't even need to setup the resolver at all, because we just pass that single definition as a
schemaprop.Also, we didn't migrate all our validation logic. Our API validation, config, and local storage validation still uses zod. So all we migrated were the 2-3 out of several large forms we had done with zod before realising it was terrible and switching over to Yup for those.