react-hook-form / documentation

📋 Official documentation
http://react-hook-form.com
MIT License
724 stars 1.04k forks source link

I suggest to add « react-hook-form » vs « formik 2.0 » section in faqs #50

Closed harobed closed 4 years ago

harobed commented 4 years ago

Hi,

I suggest to add « react-hook-form » vs « formik 2.0 » section in faqs.

Best regards, Stéphane

bluebill1049 commented 4 years ago

thanks @harobed I will update that tonight :) it's pretty much controlled vs uncontrolled and react hook form is purely build by hook too.

bluebill1049 commented 4 years ago

actually I am going to leave my answer here and we can all contribute to the answer.

bluebill1049 commented 4 years ago

react-hook-form and Formik?

First of all, both libs try to solve the same problem which is making form building experience easy and great. However, there are some fundamental differences between the two, react-hook-form is built with uncontrolled input in mind and try to provide your form with best performance and least re-render if possible. On top of that, react-hook-form is built by React Hook and used as hook, which means there is no Component for you to import. Here are some of the differences:

React Hook Form Formik
Component uncontrolled controlled
Rendering minimum re-render re-render according to local state (as you type in the input)
API Hooks: no components to wrap Component + Hooks: wrapper components (RenderProps, Form, Field)
Status Small Community: New lib Large Community: well-established/most popular form lib in the community
Size Small Meidum 2x bigger than React Hook Form
Validation Built-in & Yup Build your own & Yup
Learning curve Low Medium

Conclusion: I believe both lib/solution can make and achieve great results in form building, and both libs are trying to help developers around the world to make form building life easier and fun.

@barrymay @JeromeDeLeon @stramel feel free to add or edit

bluebill1049 commented 4 years ago

let me know what you guys think of the answer as well before I updated it on the website. feel free to adjust and leave questions too.

bluebill1049 commented 4 years ago

What about the lib learning curve? IMHO react hook form is very easy to use because it's built by an average developer hahaha and tries to make form simple for myself and others.

bluebill1049 commented 4 years ago

@harobed you want to migrate this issue to the website repo? I am going to close it here for now, cause it's not an issue.

Skaronator commented 4 years ago

You can actually move issues to other repos https://help.github.com/en/github/managing-your-work-on-github/transferring-an-issue-to-another-repository

harobed commented 4 years ago

What about the lib learning curve? IMHO react hook form is very easy to use

@bluebill1049 yes, react-hook-form learning curve is lower that formik.

harobed commented 4 years ago

Thanks ❤️ @bluebill1049

bluebill1049 commented 4 years ago

my pleasure and thank you for your suggestion too :)