Formik sucks, is there a decent lib or the best way is to build your own forms?

This page summarizes the projects mentioned and recommended in the original post on /r/reactjs

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • react-final-form

    🏁 High performance subscription-based form state management for React

  • Another library that does this is react final form, but RHF has better typescript support, works using hooks, and has some excellent documentation.

  • react-hook-form

    📋 React Hooks for form state management and validation (Web + React Native)

  • Have you used https://react-hook-form.com/? This is the only one I've been investigating, in my current project there are a lot of complex forms, and I'm wondering if this lib can handle a lot of shit.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • react-jsonschema-form

    A React component for building Web forms from JSON Schema.

  • React Json Schema Form Is good for creating plain forms from a JSON Schema spec.

  • formuj

    A delightful React form framework

  • I've used formik for a very long time, I even wrote a form builder on top of it, I've never really had any problems aside from performance. RHF has some bizzare design decisions that in my experience aren't properly explained in the docs (why do I have to register inputs? what exactly is useController supposed to do?) and the documentation itself is extremely labyrinthine. And once you get to the more complicated forms where every field needs to be a controlled component then it is barely more performant than formik and a lot more messy. With formik at least you have a central context that is easy to understand and you can be sure that basically everything you need is in there - in RHF this functionality is spread across six(?) hooks that all do different things.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts