Skip to content

In this project, you'll see how React's advanced features make it easy to handle even the most complex projects.

Notifications You must be signed in to change notification settings

haiderali780/Authentication-Form

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Authentication-Form

This is a dummy login form built with React that demonstrates the use of local storage, the useReducer hook, the React Context API, side effects, forwardRef, useImperativeHandle, and the useEffect hook.

Features

  • Local storage: The login form saves the user's email and password to local storage when the user logs in, so that the user doesn't have to re-enter their credentials on subsequent visits to the site.
  • useReducer hook: The login form uses the useReducer hook to manage the state of the email and password input fields. This allows for more complex state management without the need for Redux.
  • React Context API: The login form uses the React Context API to pass data and functions down to child components without the need for props drilling.
  • Side effects: The login form uses the useEffect hook to check the validity of the email and password inputs every 500ms. If both inputs are valid, the form becomes submitable. The useEffect hook is also used to clear the timeout when the component is unmounted.
  • forwardRef: The login form uses the forwardRef function to pass a ref to a child component.
  • useImperativeHandler(): The login form uses the useImperativeHandle hook to expose a child component's methods to the parent component.

How to use

  1. Clone the repository and navigate to the directory:
  1. Install the dependencies: npm install
  2. Start the development server: npm start
  3. The login form will be available at http://localhost:3000.

Contributions

If you'd like to contribute to the Authentication-Form, please fork the repository and create a pull request with your changes.

Support

If you have any questions , please contact me at haiderali782002@gmail.com

License

This project is not licensed.

About

In this project, you'll see how React's advanced features make it easy to handle even the most complex projects.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published