| id | useTable |
|---|---|
| title | useTable |
function useTable<TFeatures, TData, TSelected>(tableOptions, selector?): PreactTable<TFeatures, TData, TSelected>;Defined in: useTable.ts:113
Creates a Preact 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 Preact 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.
TFeatures extends TableFeatures
TData extends RowData
TSelected = TableState<TFeatures>
TableOptions<TFeatures, TData>
(state) => TSelected
PreactTable<TFeatures, TData, TSelected>
const table = useTable(
{
_features,
_rowModels: {},
columns,
data,
},
(state) => ({ pagination: state.pagination }),
)
table.state.pagination