Q&A
upGrad

upGrad

Online Coaching

Building Careers of Tomorrow

Leave a Review for upGrad

Have you studied at upGrad

Leave a Review
Faculty
Study Material
Doubt Clearing
Infrastructure
Tech Support
Leave a Review
Faculty
Study Material
Doubt Clearing
Mentorship & Teaching Style
Tech Support
Abdul Rehman August 09, 2023 3.8

Here we have added two new states called isLoading and onEndReachedThreshold. isLoading keeps track of whether we're currently fetching data, and onEndReachedThreshold fires the onEndReached callback when the user has scrolled to within 10% of the end of the list. We created a new function called fetchMore that runs when onEndReached is fired. It checks if we're already loading data, and if not, it fetches the next page of data and updates our list. Finally, we added the new necessary props to our FlatList component. The FlatList component will now dynamically load data as the user scrolls to the end of the list.