Skip to content

Switch to React Hook Form #804

Closed
Closed

Description

@david-crespo

Low priority, just wanted to get my thoughts down. This was prompted by @zephraph saying he wished Formik had a built in format/parse props on fields so you could build value transformation into the field instead of having to do it in onSubmit. RHF sort of has this (see resolver here) though it's still at the form level. RFF has parse and format props on Field.

In any case, parse/format is not the only concern. Discussion on the Formik v3 umbrella issue suggests that Formik development has stalled since we chose it in September 2021. The last release was in June 2021. Another dev has a 10k line v3 PR and is considering forking to keep the library going. To me this doesn't bode well, and I've since heard good things about react-hook-form. Another possibility is react-final-form, which has a more similar API to Formik but feels slightly shoddier (can't substantiate this impression yet). Maybe it's just the ugly website. RHF has about 5x RFF's weekly DLs. I like that RFF has a framework-agnostic core.

Now that we actually have a bunch of forms it should be pretty easy to tell whether we like a given API for our application and how much work migrating would be, and what the value will be. I think this is worth a few hours of exploration.

Activity

  1. changed the title [-]Consider changing form library[/-] [+]Switch to React Hook Form[/+] on Jul 28, 2022
  2. david-crespo commented on Jul 28, 2022

    @david-crespo
    CollaboratorAuthor

    Justin and I agree it is officially the plan to switch. It really looks like Formik is never getting another update and the proposed fork is not happening soon and would be dubiously supported/adopted even if it did. Switching shouldn't be too bad, especially thanks to #1064 getting Formik out of @oxide/ui.

  3. benjaminleonard commented on Nov 1, 2022

    @benjaminleonard
    Contributor

    Congrats! 🎉

  4. self-assigned this
    on Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions