DEV Community

Discussion on: React & Formik Build forms more efficiently

Collapse
przpiw profile image
Damian Piwowarczyk Author

useFormik it is a custom hook that returns state and helper methods.
We reuse the same exact change handler function handleChange for each HTML input
We pass an id and name HTML attribute that matches the property we defined in initialValues
We access the field’s value using the same name (email -> formik.values.email)
I hope that answered your question :)