1. 下载相关包
npm i redux react-redux redux-thunk redux-devtools-extension
2.安装react开发工具(chrome浏览器插件)
3. 安装redux的开发工具(chrome浏览器插件)
4.在store/index.js中进行配置导入
import { createStore, applyMiddleware } from 'redux'
import rootReducer from './reduces'
import thunk from 'redux-thunk'
import { composeWithDevTools } from 'redux-devtools-extension'
const store = createStore(rootReducer, composeWithDevTools(applyMiddleware(thunk)))
export default store
配置完成后进入Chrome浏览器React页面时 插件图标会高亮显示
5. 效果图
每一次redux的操作,都会有记录