我可以使用 Chrome Dev Tools 查看/修改 Redux 商店吗 [英] Can I view/modify the Redux store using Chrome Dev Tools

查看:19
本文介绍了我可以使用 Chrome Dev Tools 查看/修改 Redux 商店吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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 Dev Tools 查看/修改 Redux 商店吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆