Uncaught Error: Actions must be plain objects. Use custom middleware for async actions. at Object.performAction (<anonymous>:1:40685)
at liftAction (<anonymous>:1:34238)
at dispatch (<anonymous>:1:38232)
at Object.getSingleSearchResult (index.jsx:207)
at t.value (index.jsx:44)
at fa (react-dom.production.min.js:5065)
at da (react-dom.production.min.js:4826)
at ca (react-dom.production.min.js:4800)
at va (react-dom.production.min.js:5202)
at En (react-dom.production.min.js:1737)store.js文件:import { createStore, applyMiddleware, compose } from 'redux';import reducer from './reducer/';import thunk from 'redux-thunk';const win = window;const middlewares = [];if (process.env.NODE_ENV !== 'production') {
middlewares.push(thunk);
}const storeEnhancers = compose(
applyMiddleware(...middlewares), (win && win.devToolsExtension) ? win.devToolsExtension() : (f) => f
);export default createStore(reducer, storeEnhancers);
1 回答
米脂
TA贡献1836条经验 获得超3个赞
刚刚把文件写成这样解决了,怎么回事呢?
import { createStore, applyMiddleware, compose } from 'redux';import reducer from './reducer/';import thunk from 'redux-thunk';export default createStore(reducer, applyMiddleware(thunk));
添加回答
举报
0/150
提交
取消