模块导出不适用于 redux 持久化

问题描述

我正在我的 React 项目中实施 redux-persist,但我的模块导出无法正常工作。

我有一个 store.js 文件

store.js

我有我的 index.js 文件

index.js

我继续在 index.js 文件中收到此错误

Attempted import error: 'persistor' is not exported from './store/store'.

我不知道此时我需要做什么。我已经尝试了所有我能想到的方法包括使用 module.export.store 等单独添加它们。

编辑:

我这样改了还是不行

const persistConfig = {
    key: "root",storage,stateReconciler: autoMergeLevel2,};

const pReducer = persistReducer(persistConfig,reducer);
const store = createStore(pReducer,devToolsEnhancer());
const persistor = persistStore(store);

module.exports = {
    store,persistor,};

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)