Skip to content

fix(react-db): make getNextPageParam optional in useLiveInfiniteQuery#1268

Open
sleitor wants to merge 2 commits intoTanStack:mainfrom
sleitor:fix/optional-getNextPageParam
Open

fix(react-db): make getNextPageParam optional in useLiveInfiniteQuery#1268
sleitor wants to merge 2 commits intoTanStack:mainfrom
sleitor:fix/optional-getNextPageParam

Conversation

@sleitor
Copy link

@sleitor sleitor commented Feb 18, 2026

Summary

getNextPageParam is required in UseLiveInfiniteQueryConfig but is never called anywhere in the implementation. Pagination is determined entirely by the peek-ahead strategy (dataArray.length > totalItemsRequested).

This forces every consumer to write a callback that has zero effect on behavior.

Change

Mark getNextPageParam as optional (?) with a @deprecated JSDoc tag explaining that pagination is handled internally.

This is a non-breaking change — existing code that passes getNextPageParam continues to work; code that omits it no longer gets a type error.

Fixes #1241

getNextPageParam is required in UseLiveInfiniteQueryConfig but is never
called — pagination is determined entirely by the peek-ahead strategy.

Mark it as optional with a @deprecated JSDoc tag so consumers aren't
forced to write dead code.

Fixes TanStack#1241
@changeset-bot
Copy link

changeset-bot bot commented Feb 18, 2026

🦋 Changeset detected

Latest commit: 5f6e958

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@tanstack/react-db Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cleanup: getNextPageParam is required but never used in useLiveInfiniteQuery

1 participant

Comments