Course Content
Expert React
4. Formik
Powerful Form Library for ReactGet Started with FormikCustom Formik HookInvolve Formik into React componentAdd Initial ValuesForm SubmissionForm ValidationChallenge OverviewChallenge: useFormik HookChallenge: Binding Formik with React ComponentChallenge: Add Initial ValuesChallenge: Form SubmissionChallenge: ValidationFormik Section Sum Up
6. Next Steps
Expert React
Challenge: Form Submission
Task
Add the logic to handle the form submission. Since we are not working with a real server, we will display the form data in the console and in the alert. Follow the steps below:
- Target the input field value responsible for the user's first name and assign its value to the
userName
variable. - Target the input field value responsible for the user's last name and assign its value to the
userLastName
variable. - Target the input field value responsible for the user's mail and assign its value to the
userMail
variable.
Hint
1. To retrieve the value of the input field responsible for the user's first
name, use the
2. To retrieve the value of the input field responsible for the user's last name, use the
3. To retrieve the value of the input field responsible for the user's email, use the
values.firstName
. 2. To retrieve the value of the input field responsible for the user's last name, use the
values.lastName
. 3. To retrieve the value of the input field responsible for the user's email, use the
values.mail
.
Everything was clear?
Section 4. Chapter 12