这里不想用不可变数据。
只是想在 shouldComponentUpdate 里面:
shouldComponentUpdate(nextProps, nextState) {
return JSON.stringify(this.props) !== JSON.stringify(nextProps);
}
这里不想用不可变数据。
只是想在 shouldComponentUpdate 里面:
shouldComponentUpdate(nextProps, nextState) {
return JSON.stringify(this.props) !== JSON.stringify(nextProps);
}
没仔细研究, 搜了一下貌似问题不小, 需要留一下 http://stackoverflow.com/questions/1068834/object-comparison-in-javascript