State Management · Senior · Question 27 of 75
What must you configure for useInfiniteQuery?
- ✓Correct answer:
initialPageParamandgetNextPageParam - 2
pageSizeandtotalPages - 3A
cursorin the key and manualrefetchon scroll
Explanation
Data is { pages, pageParams }; getNextPageParam(lastPage) returns the next cursor or undefined when done (hasNextPage becomes false). fetchNextPage is often triggered by an IntersectionObserver.