user-login

A react-based app to let user login.


Author: Chu-Te (Ethan) Chen Published on: June 10, 2021

A react-based app to let user login.

Demo: http://chu-te-ethan-chen.github.io/user-login

Github code: https://github.com/Chu-Te-Ethan-Chen/user-login

  • This app consists of 4 components: UI, MainHeader, Login, and Home.
  • Using useReducer to manage the state of email, password, and their validation.
  • forwardRef() allows parent components to access components through ref.
  • useImperativeHandle customizes the instance value that is exposed to parent components when using ref.
  • Using Context to manage the user’s authentication throughout the entire app.
  • Implemented auto login feature through useEffect.
  • Store status in localstorage of the browser.

Learning: useEffect, useReducer, Context, useImperativeHandle, forwardRef()

Github code: https://github.com/Jordon-Chen/user-login