是否有任何方法可以更新平面列表或从其他屏幕重新渲染它 我有屏幕A和B 在A中,我从API提取数据 在B中,我添加了更多数据
我的问题是我添加的数据直到退出应用并重新打开后才会出现
在屏幕A中,我有平面列表
componentWillMount(){
AsyncStorage.getItem('customer_id').then((customer_id) => {
AsyncStorage.getItem('sale_id').then((sale_id) => {
this.props.get_notes(sale_id,customer_id)
});
});
}
<FlatList
style={{flex:1}}
data={this.props.data}
renderItem={this._renderListID}
keyExtractor={item => item.note_id}
/>