DEV Community

Cover image for 🔥 5 Best Libraries to Develop React.js Forms 2024

🔥 5 Best Libraries to Develop React.js Forms 2024

Anson Ch on January 31, 2024

For a while now, I have been using React at the company I work for, catering to consumer facing and back-office applications across industries. We ...
Collapse
 
anmolbaranwal profile image
Anmol Baranwal •

I've never used any others; I've only used Zod + React hook form.

Collapse
 
ansonch profile image
Anson Ch •

We also mainly use yup + react hook form for most of our developments, thought that its interesting to explore other alternative 🙂

Zod is pretty similar to Yup though, any idea which is better/preferred?

Collapse
 
anmolbaranwal profile image
Anmol Baranwal •

I'm not an expert. LOL!

Anyway, I found an article by LogRocket about Yup vs Zod

Collapse
 
fxdave profile image
David Judge • • Edited

Zod has the .required() by default, and you explicitly specify when something is optional. It's a wiser default. And it had the best typescript support when I chose a validator for my project Cuple RPC

Collapse
 
grantdotdev profile image
Grant Riordan •

A good article, I’d perhaps replace the photo of the React Hook Form to a ReactJS usage, or rethink the naming of the article to React / React Native forms as the example relates to its usage in React Native not ReactJs.

For Ant Design do you have to install the full library to only utilise the form components? If not it’d be worth explaining this to readers. Also perhaps showing the use of css-in-js and how it handles more complex validation rules.

For Tanstack it may be worth explaining what field metadata touched means and some of the internal workings as this could impact someone’s decision around complexity / understanding.

Good work though. Very useful article for people more familiar with react based development.

Collapse
 
lukinov profile image
lukinov •

Fantastic, a very good toptic, very helpful. I would also like to see useful best commercial library like formengine.io or form.io. It would be great to compare the available libraries with good technical support and documentation.

Collapse
 
machineno15 profile image
Tanvir Shaikh •

this are good but it a bit complicated implementation , we can also use mantine from hooks, if you want a lighter form validation library we can install it separately and use.

mantine.dev/form/use-form

Collapse
 
trinhcamminh profile image
MINHCT •

Hey bro Validex is still not ready for production, right? Good article anyway

Collapse
 
anthonyvii profile image
Anthony Vinicius •

Great comparison!

Collapse
 
ansonch profile image
Anson Ch •

Thank you!!

Collapse
 
andylarkin677 profile image
Andy Larkin •

I love reading articles and being blown away with delight!
it's a pleasant feeling when you like the flow of information

Collapse
 
ansonch profile image
Anson Ch •

Thank you!! Glad that you love the article 😆