(转)解决RN-FlatList onEndReached 刷新次数频繁问题
作者:互联网
项目开发时,使用FlatList 处理加载时,采取多种方式处理后,Android可以正常加载分页显示,ios无法正常加载,会频繁调用onEndReached;现参考文档https://www.jianshu.com/p/79fb4c6b3214解决,Android、ios共同存在的问题;
<FlatList style={{flex: 1}} data={ExamHomeSpace.patientExam} renderItem={this._renderAloItem} refreshing={false} onRefresh={() => { this.refreshData(); }} onEndReachedThreshold={0.01} onScrollBeginDrag={() => { canAction = true; }} onScrollEndDrag={() => { canAction = true; }} onMomentumScrollBegin={() => { canAction = true; }} onEndReached={() => { if (this.isCanLoadMore) { this.loadzMore(); this.isCanLoadMore = false; } }} onContentSizeChange={() => { this.isCanLoadMore = true // flatview内部组件布局完成以后会调用这个方法 }} />
标签:FlatList,onEndReached,isCanLoadMore,canAction,RN,true,Android,加载 来源: https://blog.csdn.net/IT_luntan/article/details/88020362