redux 相关
安装 redux
yarn add redux
yarn add react-redux
yarn add redux-thunk
安装 redux-devtools 调试工具命令
yarn add redux-devtools-extension
yarn add redux react-redux redux-thunk redux-devtools-extension
在 store.js 引入
// 引入 redux-devtools 调试工具命令
import {composeWithDevTools} from 'redux-devtools-extension'
export default createStore(reducer,composeWithDevTools(applyMiddleware(thunk)))
安装成功
import {createStore,applyMiddleware} from 'redux'
import reducers from './reducers'
import thunk from 'redux-thunk'
// 引入 redux-devtools 调试工具命令
import {composeWithDevTools} from 'redux-devtools-extension'
export default createStore(reducers,composeWithDevTools(applyMiddleware(thunk)))