An simple skeleton to use hooks, typescript in a reactjs app
- Run
yarn install - Run
yarn start
- 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.tsxand add page layout - Create routes using
useRoutes()inApp.tsxto declare all pages - Create a
useLoginhook to mock the authentication process - Add unit tests
useLoginusing react-testing-library/hooks - Create a
LoginPage containing two inputs and two buttons- Add loading support
- Show success/error messages
- Add unit tests for
Loginpage using react-testing-library
- 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