1. Install the story
npm install redux
Copy the code
2. Create a redux folder (dedicated to redux-related files)
3. Introduce createStore and reducer into the store.js file and expose the reducer
4. State Reducer file
5. Call redux’s API in the component
- To obtain state
- Let store perform operations on state
- After the component is mounted, it continuously detects state changes in redux and drives page data updates