Skip to content
Discussion options

You must be logged in to vote

Yes, they fit well: TanStack Table is headless and only needs a data array, which is what an RTK Query hook gives you. Two things to watch:

  1. Give the table a stable empty array while loading: data ?? [] creates a new array on every render.
  2. For server-side paging, keep the page in table state, pass it to the query args, and turn off the table's own pagination.

With TanStack Table v9 (the useTable from the docs you linked), adapted from its TanStack Query example:

import { useCreateAtom, useSelector } from '@tanstack/react-store'
import { rowPaginationFeature, tableFeatures, useTable } from '@tanstack/react-table'
import type { PaginationState } from '@tanstack/react-table'

const features = 

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by steinarb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants