In this project I want to show you how we could use the library Formik to handle our forms without tears.
In my opinion Formik is the best library to work with forms in ReactJS thanks to its ease of use and its large number of options and configurations.
Besides, Formik has a seamlessly integration with Yup, a librar that allows us to validate our inputs defining in an object the requirements.
Integrating Formik in a React project using the provided high order component withFormik
or the component Formik
.
Validanting a form using Yup for defining a validation schema. .
Use yarn start
to run the app in the development mode and open http://localhost:3000 to view it in the browser.