mirror of
https://github.com/TanStack/table.git
synced 2026-11-18 18:55:54 +00:00
* 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>
1.2 KiB
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