Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 1 KB

File metadata and controls

26 lines (21 loc) · 1 KB

reactjs-hooks-typescript-practice

An simple skeleton to use hooks, typescript in a reactjs app

Run the project

  1. Run yarn install
  2. Run yarn start

Features

  • Add package into package.json and use react-app-rewire to initialize project folder
  • Set eslint, prettier, typescript, pre-commit hooks to achieve better code style and avoid errors
  • Create a home page called App.tsx and add page layout
  • Create routes using useRoutes() in App.tsx to declare all pages
  • Create a useLogin hook to mock the authentication process
  • Add unit tests useLogin using react-testing-library/hooks
  • Create a Login Page containing two inputs and two buttons
    • Add loading support
    • Show success/error messages
  • Add unit tests for Login page using react-testing-library

Todo

  • Add ErrorPage.tsx and Loading.tsx
  • Add BasicLayout.tsx to the page
  • Login.less: prevent break encapsulation
  • Login.tsx: Clear the inputs after login success