我使用扁平列表来显示数据。每次我都要返回到同一页来显示新添加的数据。任何人都可以在不刷新页面的情况下建议数据。
发布于 2020-02-07 21:37:10
像这样,实现刷新控制/拉取刷新,这样就可以刷新而不是往回走。
<FlatList
data={this.props.notificationReducer.notifications}
renderItem={({item, index}) => {
return this.renderEachCard(item.description, item.added_on, index);
}}
refreshControl={
<RefreshControl
refreshing={this.props.notificationReducer.pullToRefresh}
onRefresh={this.getNotificationData}
/>
}
/>希望你能得到它。请不要有疑问
https://stackoverflow.com/questions/60113548
复制相似问题