美文网首页
redux调试工具redux-devtools

redux调试工具redux-devtools

作者: 小小的开发人员 | 来源:发表于2019-06-03 17:20 被阅读0次

  
  Redux DevTools是Chrome浏览器中的一款调试插件,它可以用于调试redux中的状态更改,我们可以清晰的看到当前store仓库中的state是怎么样的,在可视化工具的左边,我们还可以看到触发的action的变化。

  1. 先在谷歌应用商店下载redux-devtools

开发环境



生产环境


  1. 在react中配置
import { createStore,  compose} from 'redux'
import reducer from './reducer'

const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const store = createStore(reducer, /* preloadedState, */ composeEnhancers())

export default store
  1. 监测store


相关文章

网友评论

      本文标题:redux调试工具redux-devtools

      本文链接:https://www.haomeiwen.com/subject/wdfhxctx.html