查了下有两种方式,一种是设置extraData={this.state},然后再调用setState,这种应该是比较粗的方式
另外种比较细的是item继承pureComponent,然后自己重写shouldComponentUpdate
如以下链接
https://stackoverflow.com/questions/46994262/how-to-update-a-single-item-in-flatlist-in-react-native
查了下有两种方式,一种是设置extraData={this.state},然后再调用setState,这种应该是比较粗的方式
另外种比较细的是item继承pureComponent,然后自己重写shouldComponentUpdate
如以下链接
https://stackoverflow.com/questions/46994262/how-to-update-a-single-item-in-flatlist-in-react-native
本文标题:2019-01-13 flatlist更新
本文链接:https://www.haomeiwen.com/subject/thdldqtx.html
网友评论