You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to use convexQuery with tanstack useInfiniteQuery and a paginated convex query?
I have infinite scroll working with the following react-query / convex integration, but it does not subscribe to changes when hooked up this way. (Note that I'm using react-query here so that I can leverage it's caching capabilities when navigating between nextjs routes, allowing me to "restore scroll position" on an infinite scroll page without having to refetch data).
The suggested approach is to use useConvexPaginatedQuery,, a re-exported version of usePaginatedQuery from the convex package, for reactive pagination.
Pagination works a bit differently in TanStack Query and
The direction I'd like to take is to improve convex's usePaginatedQuery hook to stay subscribed / keep the paginated query around, but that's a significant change because currently the state for the paginated query is stored in the React hook.
Making useInfiniteQuery work is also an option but the interfaces dont' mesh naturally, if it is supported it will likely look like what you've done here, something non-reactive.
Is it possible to use convexQuery with tanstack useInfiniteQuery and a paginated convex query?
I have infinite scroll working with the following react-query / convex integration, but it does not subscribe to changes when hooked up this way. (Note that I'm using react-query here so that I can leverage it's caching capabilities when navigating between nextjs routes, allowing me to "restore scroll position" on an infinite scroll page without having to refetch data).
From the Demo in the Docs it wasn't clear to me whether you can just drop-in useInfiniteQuery here, and if so, how to handle the cursor logic.
example from docs:
The text was updated successfully, but these errors were encountered: