Client-side Pagination

Rendering
Client Component — the fetch happens in the browser, not on the server.
Hooks
useEffect (wrapping a useCallback fetcher) loads the entire post list once on mount; useState holds posts/loading/error so retries just re-run the fetch.
Caching
None — this never touches Next's Data Cache, since the request is made client-side rather than in a Server Component.
Why it helps
Pagination afterward is just posts.slice() over data already in memory, so page changes are instant with no server round trip — at the cost of downloading the whole dataset before the first render.
View on GitHub

Client-side Pagination