react.js - redux中dispatch = this.props是什么意思?
本文介绍了react.js - redux中dispatch = this.props是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
如题,不知道为什么
var {dispatch} = this.props
为什么要这么写?我console.log出啦props上就是普通的自定义的对象啊
解决方案
这是es2015的语法 和 var dispatch = this.props.dispatch 等价
这篇关于react.js - redux中dispatch = this.props是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文