Infinite Scroll & Pagination with useInfiniteQuery
Fetch paginated data and load more pages seamlessly with useInfiniteQuery.
Welcome
In this lesson you will use useInfiniteQuery to fetch paginated data and implement an infinite scroll pattern that loads more pages as the user scrolls.
What Is useInfiniteQuery?
useInfiniteQuery fetches data in 'pages'. Each page is fetched separately and appended to the cached list. It provides fetchNextPage, hasNextPage, and isFetchingNextPage utilities.
All lessons in this course
- Setting Up React Query & QueryClient
- Caching, Stale Time & Background Refetching
- Mutations with useMutation
- Infinite Scroll & Pagination with useInfiniteQuery