Loading video...
Video Failed to Load
❌ You 𝗺𝗶𝗴𝗵𝘁 not need a react form library ✅ Instead you can use the FormData API's
81,577 views • 2 years ago •via X (Twitter)
11 Comments

I've been working professionally with React for more than 8 years and I compiled all my knowledge into 100+ infographics just like this one. Check them out ↓

I've been working professionally with React for more than 8 years and I compiled all my knowledge into 100+ infographics just like this one. Check them out ↓

**might** is the catch😅

☝️ exactly

Can I do validation of a particular field based on some other field without using useEffect ?

You can do that with Zod yes an refine (superRefine) SomeSchema.superRefine(({ confirmPassword, password }, ctx) => { if (confirmPassword !== password) { ctx.addIssue({ code: "custom", message: "The passwords did not match" }); } });

"You might not need a react form library. You just need to install zod instead"

you should use zod with react-hook-form too :)

Please be clear about "might not" because you "might not" need zod as well 😅 FormData can be used for a very simple projects, however for big scale products react-hook-form is the hero. It provide fully typescript support and also validation for object and arrays 💪

I'm a heavy user and fan of react-hook-form. But I didn't realize all the native capabilities of FormData and form elements. Might reach for this first for simpler forms.

Yes I think for simpler forms using the native api makes sense. Also, I love exploring native web APIs, that's what actually drove me to write this tweet 😅. I'm a heavy user and fan of react-hook-form as well, I used formik before and really like the API that rhf offers.
