0
Fork 0
mirror of https://github.com/TanStack/table.git synced 2026-11-18 18:55:54 +00:00
table/docs/framework/react/reference/index/functions/useTable.md
Kevin Van Cott 09598d2e41
feat: support infinite pagination page sizes (#6526)
* feat: support infinite pagination page sizes

* add devtools to all with-tanstack examples

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-07 13:11:04 -05:00

1.2 KiB

id title
useTable useTable

Function: useTable()

function useTable<TFeatures, TData, TSelected>(tableOptions, selector?): ReactTable<TFeatures, TData, TSelected>;

Defined in: react-table/src/useTable.ts:149

Creates a React table instance backed by TanStack Store atoms.

The optional selector projects from table.store; the selected value is exposed on table.state and compared shallowly for React re-renders. Omit the selector to subscribe to every registered table state slice, or pass a narrower selector and use table.Subscribe lower in the tree for targeted subscriptions.

Type Parameters

TFeatures

TFeatures extends TableFeatures

TData

TData extends RowData

TSelected

TSelected = TableState<TFeatures>

Parameters

tableOptions

TableOptions<TFeatures, TData>

selector?

(state) => TSelected

Returns

ReactTable<TFeatures, TData, TSelected>

Example

const table = useTable(
  {
    features,
    columns,
    data,
  },
  (state) => ({ pagination: state.pagination }),
)

table.state.pagination