0
I have a flatList
which loads 20 records at a time, when it arrives at the end of the list, the component onEndReached
calls my method that carries over 20, and so loads up to bring everyone, however, when my records run out, it still tries to search, which decreases the performance of my App.
I tried to add an IF to the onEndReached
, but as it is inside a flatList I could not do it.
someone has a solution for this?
Example of my Code:
<FlatList
data={this.state.data}
renderItem={({ item }) => (
<ListItem
title={item.conta}
subtitle={item.saldo}
/>
)}
keyExtractor={(item) => {
return item.id;
}}
onEndReached={this.makeRemoteRequest}
onEndReachedThreshold={0.1}
/>
Show, it worked. Thanks for the help Maycon.
– Luan Martins Gepfrie
Friend if you can score the answer, I’ll be very grateful.
– Maycon F. Castro