Formik
Introduction
“Build forms in React, without the tears”. Formik makes it super easy to handle all the state management validation errors, and submitting of forms. It was the first mainstream React forms package, and while there are some alternatives, there hasn’t been a need to switch (yet).
MUI Integration
For consistent design of forms, we obviously need to hook int MUI components, however it would be incredibly inefficient to repeat this logic in each separate form. Using the useField
hook, we’ve written modular MUI + Formik components which should be used in every form in place of plain MUI components or plain Formik components.
Future
- Honestly not sure if the
useField
hook is the best option - Works well with MUI currently, but we will likely move away from this in the future
- The
useFormik
hook seems really nice