javascript - react native onEndReached中的Recyclerlistview不断触发
问题描述
在滚动一次时,只要列表中有新数据,onEndReached 就会一直触发。这是我的代码
<RecyclerListView
style={AppStyle.flexOne}
onEndReached={this.onScrollTillEnd}
onEndReachedThreshold={Globals.LIST_SCROLL_THRESHOLD}
layoutProvider={this.layoutProvider}
dataProvider={this.state.dataProvider}
rowRenderer={this.rowRenderer}
scrollViewProps={{
refreshControl: (
<RefreshControl
refreshing={initialFetch}
onRefresh={this.onRefresh}
/>
)
}}
/>
这是 onEndReached 触发的函数
onScrollTillEnd = async () => {
await this.fetchVisitorList();
}
而 onEndReachThreshold 为 0.1 并尝试更改值但没有效果。请帮忙
解决方案
推荐阅读
- python - Flask Python - 从 URL 列表中添加指向其他网站的链接
- configuration - 使用 Keycloak,您可以从文件中加载 LDAP 配置吗?
- git - GitHub 是否使用非对称 SSH?
- bash - Ubuntu 19.10 shell 脚本只能从 /Desktop/ 目录打开
- java - 使用 XMLUnit 比较 xml
- haskell - 如何在 Haskell 中将两张牌合并在一起?
- for-loop - 如何在 pyspark 中进行并行计算以提高效率,而不是循环“for”?
- c - 如何在 C 中解析同时包含数字和文本的文本文件?
- php - Sqlite 在 unti 测试中忽略数据库约束
- javascript - 如何在表单提交之前显示一条甜蜜的消息?