React Redux-Persist通过不同的URL端点持久化

问题描述

我正在编写一个React应用程序,人们可以在其中扫描QR码并根据表号将其重定向到我的网页。

示例端点:/?p=182*7代表商店编号182表7

我已经使用redux-presist设置通过刷新来持久保存表格的信息,包括订单/价格等:

const persistConfig = {
  key: "root",storage,};
const composeEnhancers = window.__Redux_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const persistedReducer = persistReducer(persistConfig,reducers);

let store = createStore(
  persistedReducer,composeEnhancers(applyMiddleware(thunk))
);
let persistor = persistStore(store);

ReactDOM.render(
  <Provider store={store}>
    <PersistGate loading={null} persistor={persistor}>
      <App />
    </PersistGate>
  </Provider>,document.getElementById("root")
);

但是如果我交换到另一个端点,请说/?p=182*8,我的数据仍将保留,这是不希望的。

我该如何解决此问题?

解决方法

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

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

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