Leave a Review for upGrad
Have you studied at upGrad
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.