TutorialsCourses
Course Menu
Formik for Beginners

Formik Introduction

Introduction

Forms are a very tricky topic in general. The React ecosystem has seen a an endless rise and fall of various form libraries. One such library that has stuck around is Formik. This course is only going to touch the the basics of forms as well as the basics of Formik. It'll be a good introduction if you're confused about how to get started.

We'll start with setup and then walk through different types of Field configurations Formik provides, as well as how to simplify fields with hooks. Then we'll walk through the one-off form types like checkbox and radio fields. Following up with errors and validation.

Then we'll dive into building a login form and a registration form, and end the course with building custom fields.

Why Formik

Formik is one of the few libraries that understands the performance matters when rendering forms. React will re-render on every keypress so understanding performance trade offs is absolutely key to make your forms feel fluid.

It keeps within the core of React meaning all the time you've spent googling for how to make things more performant will be able to be applied to Formik. It's fast out of the box though so you won't need to do much tuning.

It also is written in Typescript so you get full type checking during your development flow.

Finally unlike many form libraries prior to Formik it works with nested objects, and arrays with ease. No more worrying about having to restructure your data just to use a library.

Overall Formik is easy to incrementally add to your stack and provides sane defaults so you won't have to re-engineer the wheel every time you want to add a new field.