New: Cookbooks and AI ExplanationsStep-by-Step recipes to solve problems connected to Roadmaps and Cheat Sheets. Need more details? Use AI buttons for structured and simple explanations with concrete examples throughout the whole platform.Take a look
Why load two thousand rows just to show the first twenty on screen?
What you'll have at the end
A feed component wired to useInfiniteQuery that fetches one page of twenty posts at a time behind a Load more button, anchored to a cursor so pages already on screen stay correct even after new posts land.
You need
A component already rendering a list of posts from a single fetch call, where the endpoint currently returns the entire result set in one response with no page size and no cursor.
Not covered
Triggering the next page automatically as the reader scrolls, and virtualizing the list once it grows past a few hundred rendered rows; both start from the paginated fetch this recipe builds.
Leans on
Checked 22 Aug 2026
Part of the Frontend State Management Beyond Redux cookbook