我正在使用redux-persist,并且将对象嵌套在如下所示的reducer中
const initState = {
ian: "initial value",
details: {
prop1: "inital value",
prop2: "inital value"
}
};
// Reducer (SomeReducer) create
const persistcnfg = {
key: "SomeReducer",
storage: storage
},
const rootReducer = combineReducers({
someReducer: persistReducer(persistcnfg, SomeReducer)
});
我可以看到更改保存了localstorgae,但是当重新加载页面时
值更新为1,但是details
值重置为intialState。
我如何也可以持久保留嵌套对象。