onEndReached firing multiple times
See original GitHub issueDescribe the bug
onEndReached method gets fired multiple times when scrolling to the end of scroll view when trying to fetch next set of data for pagination.
Code:
return (
<View style={styles.container}>
<MasonryList
contentContainerStyle={styles.bListContainer}
data={feedActivites}
keyExtractor={(item) => item.id}
numColumns={2}
showsVerticalScrollIndicator={false}
renderItem={({ item }) => <ActivityCard key={item.id} activity={item} />}
refreshing={feedFetching}
onRefresh={() => getInitialFeedActivites()}
onEndReached={() => {
console.log('onEndReached Fired!');
// getNextActivites();
}}
onEndReachedThreshold={0.1}
/>
</View>
);
}
To Reproduce Steps to reproduce the behavior:
- Add data to data array
- add onEndReached Method
- Scroll down to end of List
- onEndReached Method gets called in rapid succession multiple times
Expected behavior Should only fire one time when reaching end of list
Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
- OS: Mac OS Big Sir
- Browser: Chrome
- Version: 91
Smartphone (please complete the following information):
- Device: iPhone 12
- OS: iOS 14.5
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
FlatList onEndReached being called multiple times
The reason of triggering onEndReached multiple times is because you have not set initialNumToRender properly. onEndReached is triggered in ...
Read more >onEndReached called many many times · Issue #23060
Once you scroll Flatlist to the bottom, call onEndReached , then props changed, it call once again!
Read more >iOS : FlatList onEndReached being called multiple times
iOS : FlatList onEndReached being called multiple times [ Gift : Animated Search Engine : https://bit.ly/AnimSearch ] iOS : FlatList ...
Read more >FlatList onEndReached being called multiple times-React ...
Coding example for the question FlatList onEndReached being called multiple times-React Native.
Read more >flatlist onendreached not working
react-native-flatlist onendreached called multiple times ... Will never get fired, or some times it will be called only first time when list is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This solution worked for me. https://stackoverflow.com/a/47940952/1065877
I am not sure why I can’t reproduce this on my side. I’ll see how I can handle this internally when I can reproduce this.