//创建store的代码 程序正常使用import { createStore} from 'redux';import reducer from './reducer';const store = createStore(reducer);export default store;//改变之后报错import { createStore ,compose } from 'redux';import reducer from './reducer';const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;const store = createStore(reducer,composeEnhancers());export default store;请教可能造成的原因 拓展程序的版本是2.15.1
3 回答
HUH函数
TA贡献1836条经验 获得超4个赞
你这种连接redux-devtools-extension的方式不怎么清楚,我通常是这样连接的
import { createStore } from 'redux'
import { composeWithDevTools } from 'redux-devtools-extension'
import reducer from './reducer'
export default createStore(reducer, composeWithDevTools())
月关宝盒
TA贡献1772条经验 获得超5个赞
const reduxDevTools = window.devToolsExtension
? window.devToolsExtension()
: () => {
}
const store = createStore(reducer, compose(
reduxDevTools,
))
或
const store = createStore(reducer,
window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : undefined
);
添加回答
举报
0/150
提交
取消