thunk 与 window.__REDUX_DEVTOOLS_EXTENSION__ 报错
来源:6-4 使用Redux-thunk 中间件实现ajax数据请求
qq_亦步亦_0
2019-07-03
import { createStore, applyMiddleware, compose} from 'redux'; // 从redux中调用 createStore 方法
import reducer from './reducer';
import thunk from 'redux-thunk';
const composeEnhancers =
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ?
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}) : compose;
const enhancer = composeEnhancers(
applyMiddleware(thunk)
);
const store = createStore(reducer, enhancer);
export default store;
解决了
写回答
1回答
-
Dell
2020-08-05
好的?
00
相似问题