FlatList加载更多数据无法正常工作

时间:2020-03-23 10:15:02

标签: react-native react-native-android react-native-flatlist

我有一个FlatList组件,我想使用onEndReached和onEndReachedTreshold到达列表的末尾以获取更多数据。

问题是它无法按我期望的方式工作,我将其设置为onEndReachedThreshold = {0},但是当我到达列表末尾时,它什么也没做。

handleLoadMore = () => {
    console.log("handleLoadMOre");
};

<FlatList
    data={this.state.data}
    onEndReached={this.handleLoadMore}
    onEndReachedThreshold={0.1}
    ListFooterComponent={this.renderFooter}
    contentContainerStyle={{ flex: 1 }}
    keyExtractor={(item, index) => index.toString()}

/>

0 个答案:

没有答案