Can I view/modify the Redux store using Chrome Dev Tools

偶尔善良 提交于 2019-12-03 14:50:33

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/42340562/can-i-view-modify-the-redux-store-using-chrome-dev-tools

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