Provides the root context and container for a composable `DataTable` component, supplying a TanStack Table instance via React context to all child components. ## Key Components | Export | Type | Description | |--------|------|-------------| | `DataTableRoot` | Component | Root wrapper that provides the table instance via context | | `useDataTableContext` | Hook | Consumes the table context; throws if used outside `DataTableRoot` | | `DataTableContext` | Context | Internal React context holding the `Table` instance | | `DataTableProps` | Interface | Props for `DataTableRoot`: `table`, `children`, `className` | ## Usage Example ```typescript import { useReactTable } from '@tanstack/react-table' import { DataTableRoot, useDataTableContext } from './data-table' // Compose child components that consume the context function MyTableBody() { const table = useDataTableContext() return ( {table.getRowModel().rows.map(row => ( ... ))} ) } // Wrap with DataTableRoot to provide context function MyTable() { const table = useReactTable({ data, columns, getCoreRowModel }) return ( ) } ``` ## Notes - `DataTableRoot` renders a full-width `flex flex-col` container; additional layout classes can be passed via `className`. - `useDataTableContext` is generic — pass the row type `T` for full type safety on the returned `Table` instance. - All sub-components (`Header`, `Body`, etc.) **must** be rendered inside `DataTableRoot`; otherwise `useDataTableContext` will throw a descriptive error.