Formik is a small library that can help you with the three most annoying aspects of creating forms in React:
- Getting values in and out of the form state Validation and error messages Handling form submission.
- By collecting all of the above in one place
- Formik can keep things organized, making testing, refactoring, and reasoning your forms much easier.
This repository is a react application used to create form fields. In this instance, email field, password field and a submit button. Validation rules were applied:
- If the username or password inputs are empty, display the message "Field required" under the text input.
- f the username is not in an email format, display the message "Username should be an email" under the text input.
- If the username and password pass the above validations, then display the message "Login Successful" in an alert box.
Run npm install to install all dependencies. Once the command completes successfully, run npm start to start the application in your browser.
Javascript needs to be enabled to run this app.
For help use the standard reference sites:
- https://stackoverflow.com/
- https://developer.mozilla.org
- https://codepen.io/ Roadmap This application will be used in the development of other applications as we progress in this boot camp.
