upGrad is the South Asia’s largest higher EdTech company. With the latest technology, pedagogy, industry partners and world-class faculty, we create immersive online learning experiences for our learners globally. It is an online higher education platform providing rigorous industry-relevant programs designed and delivered in collaboration with world-class faculty and industry. Merging the latest technology, pedagogy, and services, upGrad is creating an immersive learning experience – anytime and anywhere.
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.