React Redux Turbo模块构建失败

时间:2017-10-11 13:29:52

标签: html reactjs redux

我一直在关注本教程(https://www.turbo360.co/tutorial/redux-walkthrough)并且我一直在尝试运行webpack,但构建仍然失败。任何人都知道为什么它一直在崩溃?

import { createStore, appMiddleware, combineReducers } from 'redux'
import thunk from 'redux-thunk'
import { todoReducer } from './reducers'

let store = null
export default {

   createStore: () => {
      const reducers = combineReducers({
      todo: todoReducer
   })

   store = createStore(
      reducers
      appMiddleware(thunk)
   )

   return store
   },

   currentStore: () => {
      return store
   }

}

有谁知道解决方案?

1 个答案:

答案 0 :(得分:1)

您需要导入applyMiddleware,而不是appMiddleware。这是一个错字。 applyMiddleware