I'm moving https://github.com/redwoodjs/redwood/issues/206#issuecomment-597392652 to a new issue as suggested by @damassi. Note that I personally do not have an opinion on this as I have used neither library personally. The two libraries seem roughly equivalently popular based off Google trends and GitHub. The content below is @lookfirst's:
Digging around and seeing you kind of re-invent wrappers around everything, I can see you unfortunately picked the wrong form library. I dug around for a long time myself and eventually stumbled on React Final Form and it changed everything for me.
While RHF is AWESOME (especially compared with formik) ... it has a fundamental issue, which is that every field has to be registered with a ref property, which, as you found, is a little weird... you have to register everything. Yuck
On the other hand, React Final Form is a lot cleaner (IMHO!). I ended up building a library that integrates Material UI and RFF, which is kind of similar to your 'wrapper' library, except it includes all the fun form components already! ;-)
Anyway, keep up the great work... you're obviously on a roll here!
I like React Final Form too but having to use render props feels wrong. The hooks implementation is not working as far as I know
@mohsen1 Support your statement with evidence please.
https://github.com/final-form/react-final-form-hooks
鈿狅笍 This library will re-render your entire form on every state change, as you type. 鈿狅笍
https://github.com/final-form/react-final-form-hooks#whats-the-difference-between-react-final-form-hooks-and-the-hooks-introduced-in-react-final-form-v5
Fwiw, final form currently has 261 open issues and hook form has 3, even though it's used by more people.
Fwiw, final form currently has 261 open issues and hook form has 3, even though it's used by more people.
@MarkPollmann yes. Redux Form has also been left in a similar state by the same primary author. That was a major red flag that I think should be evaluated and lead us to stay away from that project as well.
The author is on twitter. He does a lot of self promotion and speaking. Pretty sure he is a dad and limited time. Agreed that there is a lot of open issues and it is troublesome that it takes him sometimes weeks or months to close even simple PR's.
That said, in terms of libraries around forms, it has a decent api and mostly works. It is a red flag, but wasn't a deal breaker for me. I just wish he would convert it to TypeScript, then I'd be more willing to jump in and submit more PR's or at least help out more. His code can be a bit cryptic and having types would really help out a lot.
If we find a form library that we want to invest in, we could talk to the author and volunteer to help maintain it. It's going to be important to core Redwood functionality and we will be happy to put energy into whatever our final choice is. Which one would we choose if we could strike a deal to help maintain the library?
@lookfirst You list the main drawback of react-hook-form is that "every field has to be registered with a ref property" but with our implementation the user doesn't have to do any of that. That's one reason we wrapped them in our component helpers (the other main reason being the error handling).