reactjs - 类型错误:a 不是函数
问题描述
在我决定将项目移动到新的 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 };
解决方案
推荐阅读
- android - Firebase 安卓用户认证
- java - 寻找旅程的起点城市
- regex - 如果匹配发生在前 N 个字符内,则提取正则表达式
- python-3.x - 使用 SALib 在 Python 中的敏感性分析错误
- python-3.x - 不一致的 python import_module 行为
- javascript - Moment.js 处理德语 Dezember 和 Januar 不同
- sitefinity - Sitefinity 将 HTML 注入头部
- python - 在 Keras 中设计一个自定义损失函数(关于 Keras 张量中的元素索引)
- python - 如何搜索包含模块的 pip 包
- google-app-engine - 防止不检查 robots.txt 的恶意机器人启动应用引擎