[英]Redux store does not clear on refresh
We are using redux persist.我们正在使用 redux 持久化。 I am wondering, how do I clear some part of the state on refresh ?我想知道,如何在刷新时清除部分状态?
The point of redux-persist is pretty much that the store does not clear on refresh. redux-persist 的意义在于商店在刷新时不会清除。
If you only want to persist parts of the store, either only persist some reducers, not your root reducer - or use the whitelist
and blacklist
features to define what exactly should be persisted.如果你只想持久化 store 的一部分,要么只持久化一些 reducer,而不是你的 root reducer - 或者使用whitelist
和blacklist
特性来定义应该持久化的内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.