This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
- Create slice: in this step, we will define reducer, action
- Register slice to store
- Wrap provider outside app component, so we can use it global
- Use reducer function in component by using useSelector, useDispatch :
- useSelector to get current status
- useDispatch to update state.