How do I maintain react-redux state?

旧巷老猫 提交于 2019-12-11 05:11:33

问题


With react-redux all the data is contained in the store. How can I maintain the state that is stored in our store when, for example, opening multiple child tabs from a parent page or after a page refresh?


回答1:


The redux-localstorage-simple package does what you require. It is a redux middleware component that will automatically serialize redux state to local storage and restore that state, as redux initial-data, on startup.

The package also supports namespaces for the redux state trees it stores so this should allow you to clone distinct state-trees when creating new tabs.



来源:https://stackoverflow.com/questions/41481202/how-do-i-maintain-react-redux-state

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!