Capítulo 6 de 54
V9 keeps the headless model, column definitions, and rendering pattern from v8 — the actual breaking change is how you define a table: useReactTable becomes useTable, and tables now require an explicit features option (from tableFeatures({...})) instead of importing row-model getters ad hoc.
useReactTable(options) → useTable(options), matching hook naming across all TanStack libraries.features option: pass the object returned by tableFeatures({...}), listing which optional features (and their row model factories: sortedRowModel, filteredRowModel, paginationRowModel, etc.) this table actually uses. An empty tableFeatures({}) is valid — core-only, no opt-in features.table.atoms / table.store / table.state / table.Subscribe — but the old state + on[State]Change pattern still works unchanged, so this is backward compatible.tableMeta, columnMeta, filterMeta) replace v8's global interface declaration merging — no more augmenting a shared global type just to type one table's meta.column.getIsSorted()) only exists on the type if its feature is registered in tableFeatures(); the type system validates feature prerequisites.cellSelectionFeature) and Cell Spanning (cellSpanningFeature) are new in v9; Aggregation, Row Selection, Column Pinning, and Column Resizing got materially more capable (multi-aggregation per column, Shift-range selection, logical start/end pinning).ES2022, no src/source maps shipped in the published package (smaller install).import { stockFeatures } includes every feature at once, matching v8's "everything on" behavior if you don't want to think about tree-shaking yet. Table markup itself (<table>/<thead>/<tr>/<td>) is unchanged.| v8 | v9 |
|---|---|
useReactTable(options) | useTable(options) |
import row-model getters directly (getCoreRowModel(), etc.) and pass via getXRowModel options | register feature + row-model factory together inside tableFeatures({...}), pass as features |
global declaration merging for TableMeta/ColumnMeta | per-table tableMeta/columnMeta/filterMeta type slots |
| UMD/CJS + ESM builds | ESM-only |
| all APIs always present on the type | only APIs for registered features are present on the type |
useReactTable → useTable) plus the new required features option are the two changes that break every existing table — everything else (markup, most APIs) is additive or backward compatible.useLegacyTable (from @tanstack/react-table/legacy) accepts the v8-style API while running on v9 internals — see the dedicated chapter, but treat it as temporary: it's deprecated and bundles every feature by default.stockFeatures is the fastest path to "make it compile like v8 did" — swap in individual feature registration later once things are green.table.atoms/table.Subscribe to migrate; the old state/on[State]Change props still work.