我可以使用Chrome开发工具查看/修改Redux商店吗? [英] Can I view/modify the Redux store using Chrome Dev Tools
问题描述
React Dev Tools非常适合使用Redux,我可以直接进入并修改props / state以查看对相关Container的影响。
但是如果未安装所需的容器我需要直接修改Redux存储以使其显示。这是可能的Chrome Dev Tools,我能找到Redux商店,它是顶级< Provider />
组件,我甚至可以看到 getState
方法,但无论如何都要修改基础状态?
是的,你可以。 Chrome / Firefox / Electron有一个很棒的
您可以导入和导出当前商店,返回历史,改变你想要的东西等等。
React Dev Tools is great for working with Redux, I can simply go in and modify props / state to see the affect on the relevant Container.
However if the required Container isn't mounted I need to directly modify the Redux store to make it appear. Is this possible with Chrome Dev Tools, I am able to find the Redux store, it is the top level <Provider />
component, I can even see the getState
method, but is there anyway to modify the underlying state?
Yes, you can. There is a great Redux DevTools Extension for Chrome/Firefox/Electron which adds a new Redux tab to devtools:
You can import and export current store, go back in history, change whatever you want and much more.
这篇关于我可以使用Chrome开发工具查看/修改Redux商店吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!