TypeError:无法读取未定义的属性“ apply”(匿名函数)

时间:2018-10-03 15:18:05

标签: reactjs redux react-redux

  

我是redux的新手,因此在我的todolist应用程序中使用redux和react时   在createStore的store.js文件中出现错误。

     

下面是我的store.js代码

import { createStore, applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';

import rootReducer from './reducers';

const initialState = {};

const middleware = [thunk];


const store = createStore(
    rootReducer,
    initialState,
    compose(
        applyMiddleware(...middleware),
        window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
    )
);

export default store;

0 个答案:

没有答案