This repository contains a set of examples illustrating various approaches to working with forms in React.
The first two examples showcase simple login forms. These forms have been created individually using the useState and useRef hooks.
-
This form logic is preferred for key stroke validation-based.
-
This form logic is preferred for validating on submission.
The third example represents a more intricate signup form. This form employs the FormData browser method for a more straightforward and dynamic approach when dealing with complex forms.
- Signup Form
- The preferred approach for form validation involves a combination of default HTML methods and custom methods.
Each example has its own directory. To inspect the source code of an example and run the project locally, follow these steps:
- Navigate to the example directory:
cd example-directory-name
- Install the required dependencies using
npm install
oryarn install
. - Start the project with
npm run dev
oryarn dev
.
This project is licensed under the MIT License.