【发布时间】:2016-12-03 17:03:04
【问题描述】:
我需要在每个按钮单击 listView 时更新 Store 并相应地更改按钮状态图标。 unfollowing_ids 是一个数组。
componentWillMount: function() {
FollowingStore.listen(this.onChange);
},
componentWillUnmount: function() {
FollowingStore.unlisten(this.onChange);
},
onChange: function(state) {
this.setState({unfollowing_ids: state.unfollowing_ids});
},
什么是实现的有效方法。
【问题讨论】:
标签: reactjs flux reactjs-flux reactjs-native alt.js