Capítulo 12 de 54
The "table instance" (the table object returned by useTable/createTable/injectTable/constructTable) is not a <table> element — it's the single coordinating object for all table state and APIs; everything you read or mutate about the table goes through it.
columns, data, features (from tableFeatures()). The core row model is always included; extra row model factories (filtering, sorting, pagination, ...) live as slots inside tableFeatures().useTable({ features, columns, data }); Solid/Svelte/Alpine use createTable({ features, columns, get data() { return data() } }) (a getter, for reactivity); Angular uses injectTable(() => ({ features, columns, data: this.data() })); Lit uses a TableController; raw @tanstack/table-core uses constructTable and needs an explicit coreReactivityFeature if you want reactivity outside a framework adapter.rowSelectionFeature → rowSelection state, rowPaginationFeature → pagination state). table.baseAtoms are the internal writable atoms; table.atoms are the public readonly atoms per slice; table.store is a readonly flat snapshot derived from table.atoms.table.atoms.rowSelection.get() or table.store.state.rowSelection to read, table.set<Feature>(updater) to write, table.reset<Feature>() to reset to initialState.table.getRowModel(), table.getPreFilteredRowModel(), etc.) for reading rows back out, which can differ significantly from the raw data array once filtering/sorting/grouping/expansion are applied (see Row Models Guide).const features = tableFeatures({}) // core only
const table = useTable({ features, columns, data })
table.atoms.rowSelection.get() // current row selection (atom read)
table.store.state.rowSelection // current row selection (store snapshot)
table.setRowSelection((old) => ({ ...old, '0': true }))
table.resetRowSelection()
rowSelection, reuse it for sorting, pagination, columnFilters, etc.table as the one source of truth — don't reach past it into data/columns directly once the table is built; row models and column objects are the derived, correct views.table.atoms.<slice>.get() (single atom) and table.store.state.<slice> (flat snapshot) — framework adapters layer their own reactive access on top (see Table State Guide) for actual re-render-triggering reads.constructTable (raw @tanstack/table-core, no framework adapter) needs an explicit coreReactivityFeature if you want the table to be reactive at all — every official adapter wires this for you.table.getRowModel() and friends differ from raw data.Table, TableOptions, TableState full signatures.