Exercises
The following are some exercises for you to complete:
- Add a feature that clears any validation errors when the user corrects them. Use the
onChangehandler for this rather thanonBlur, since we want to let the user know as soon as they’ve corrected the error. - Add a feature that disables the submit button once the form has been submitted.
- Write tests for each of the functions within the
formValidationmodule. - The
handleSubmitfunction is long. Extract adoSavefunction that pulls out the main body of theifstatement.