Loading video...

Video Failed to Load

Go Home

❌ 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

George Moller's profile picture
George Moller2 years ago

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 ↓

George Moller's profile picture
George Moller2 years ago

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 ↓

Gaurav Pandey's profile picture
Gaurav Pandey2 years ago

**might** is the catch😅

George Moller's profile picture
George Moller2 years ago

☝️ exactly

Ayush Raj ⚡'s profile picture
Ayush Raj ⚡2 years ago

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

George Moller's profile picture
George Moller2 years ago

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" }); } });

Darth Sidious's profile picture
Darth Sidious2 years ago

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

George Moller's profile picture
George Moller2 years ago

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

Mohamed Ramadan's profile picture
Mohamed Ramadan2 years ago

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 💪

Molly Boyle's profile picture
Molly Boyle2 years ago

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.

George Moller's profile picture
George Moller2 years ago

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.

Related Videos