Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs Redux persist TypeError:超级表达式必须为null或函数(16.13.1)_Reactjs_Redux_React Redux_Redux Persist - Fatal编程技术网

Reactjs Redux persist TypeError:超级表达式必须为null或函数(16.13.1)

Reactjs Redux persist TypeError:超级表达式必须为null或函数(16.13.1),reactjs,redux,react-redux,redux-persist,Reactjs,Redux,React Redux,Redux Persist,为什么redux持续抛出类型错误:超级表达式必须为null或函数,我遵循文档,我使用的是函数组件。有什么解决办法吗 Storeconfig.ts const persistConfig = { key: 'root', storage, whitelist: ['authentication'] } const rootReducer: any = combineReducers({ authentication: Auth, profile: Profi

为什么redux持续抛出类型错误:超级表达式必须为null或函数,我遵循文档,我使用的是函数组件。有什么解决办法吗

Storeconfig.ts

const persistConfig = {
    key: 'root',
    storage,
    whitelist: ['authentication']
}
const rootReducer: any = combineReducers({
    authentication: Auth,
    profile: Profile,
    events: Events,
    loadUser: LoadUser
})

const persistedReducer = persistReducer(persistConfig, rootReducer);


const initState = {};
export const store: any = createStore(
    persistedReducer,
    initState,
    composeWithDevTools(applyMiddleware(thunk))
);


export const persistedStore = persistStore(store)
ReactDOM.render(
  <React.StrictMode>
    <Provider store={store}>
      <PersistGate loading={null} persistor={persistedStore}>
        <Router>
          <App />
        </Router>
      </PersistGate>
    </Provider>
  </React.StrictMode>,
  document.getElementById("root")
);
Index.ts

const persistConfig = {
    key: 'root',
    storage,
    whitelist: ['authentication']
}
const rootReducer: any = combineReducers({
    authentication: Auth,
    profile: Profile,
    events: Events,
    loadUser: LoadUser
})

const persistedReducer = persistReducer(persistConfig, rootReducer);


const initState = {};
export const store: any = createStore(
    persistedReducer,
    initState,
    composeWithDevTools(applyMiddleware(thunk))
);


export const persistedStore = persistStore(store)
ReactDOM.render(
  <React.StrictMode>
    <Provider store={store}>
      <PersistGate loading={null} persistor={persistedStore}>
        <Router>
          <App />
        </Router>
      </PersistGate>
    </Provider>
  </React.StrictMode>,
  document.getElementById("root")
);