【发布时间】:2015-11-14 08:25:00
【问题描述】:
我使用Reflux.connect 方法更改组件状态,但我无法获得shouldComponentUpdate 中nextState 和this.state 之间的不同部分。实际上,this.state 已经有了我期望在调用 shouldComponentUpdate 时出现在 nextState 中的新值。
当我想将 shouldComponentUpdate 与 Reflux 一起使用时,我需要做什么?
var component = React.createClass({
mixins: [Reflux.connect(store1, 'store1data'),
Reflux.connect(store2, 'store2data')],
shouldComponentUpdate: function(nextProps, nextState) {
//Here this.state.store1data is equal to nextState.store1data
}
【问题讨论】:
标签: refluxjs