类型错误:a 不是函数

时间:2021-06-01 11:05:19

标签: reactjs redux

我的应用程序运行良好,直到我决定将项目移至新的 ubuntu 系统, 当我尝试运行该程序时,它会抛出一个错误:

TypeError: a is not a function
 throw new Error('Expected the enhancer to be a function.')

我尝试查看我的 redux 商店设置,但一无所获。 这是我的代码:

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

import thunk from 'redux-thunk';
import persistedReducer from './reducers/index';

const store = createStore(
  persistedReducer,
  compose(
    window.__REDUX_DEVTOOLS_EXTENSION__ &&
      window.__REDUX_DEVTOOLS_EXTENSION__(),
    applyMiddleware(thunk),
  ),
);
const persistor = persistStore(store);
export { store, persistor };

0 个答案:

没有答案