Skip to content

mollyywang/reactjs-hooks-typescript-practice

Repository files navigation

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

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published