Pagination over a loader-backed list, driven entirely by the URL.
page is a query param, so a page change is STATE, not navigation: no
matching, no guards, no remount — only the loaders whose template depends
on the key refetch, with the previous request aborted. page pushes by
convention, so Back steps through pages, and the URL is shareable.
Reading the response is the only part that varies between backends, so each
extractor is overridable; the defaults accept { items | data } with
{ total, per_page | perPage, last_page | lastPage } (or their meta
nesting), which covers Laravel's paginator and most plain-JSON APIs.
Pagination over a loader-backed list, driven entirely by the URL.
pageis a query param, so a page change is STATE, not navigation: no matching, no guards, no remount — only the loaders whose template depends on the key refetch, with the previous request aborted.pagepushes by convention, so Back steps through pages, and the URL is shareable.const { items, page, hasNext, next, pageRange, loading } = usePagination();
Reading the response is the only part that varies between backends, so each extractor is overridable; the defaults accept
{ items | data }with{ total, per_page | perPage, last_page | lastPage }(or theirmetanesting), which covers Laravel's paginator and most plain-JSON APIs.