本页还没有译文
本页 62 段还没译成Français,下面显示的是英文原文。Devtools
还没翻译译自英文(tanstack.com)本页 62 段都还没译
TanStack Table provides framework-specific devtools adapters that plug into the TanStack Devtools multi-panel UI.
The table devtools let you inspect registered table instances, switch between multiple tables, and inspect features, state, options, rows, and columns in real time.
Note
By default, the framework adapters only include the live devtools in development mode. In production builds they export no-op implementations unless you opt into the /production entrypoints.
Installation
Install the TanStack Devtools host package and the Table adapter for your framework.
Octane, Lit, Svelte, Alpine, and vanilla do not currently ship dedicated table devtools adapters.
The Required key Table Option
The devtools identify each table by the key table option. Registration requires it. If you register a table without a key, the devtools log an error (Missing table key. Add a 'key' option to your table to use devtools.) and skip the table entirely.
const table = useTable({
key: 'users-table', // needed for devtools, omit if you don't want to use the devtools
features,
columns,
data,
})The key is also the label shown in the devtools panel selector, so give each table a unique, descriptive key.
Setup Pattern
The recommended setup has three parts:
- Give each table a unique
keyoption - Mount
TanStackDevtoolsat the app root withtableDevtoolsPlugin() - Register each table with
useTanStackTableDevtools(table)(orinjectTanStackTableDevtoolsin Angular) immediately after creating it
If you register multiple tables, the Table panel shows a selector so you can switch between them.
Setup
Disabling Registration
Each registration function accepts an enabled option if you want to conditionally register a table:
Production Builds
If you need the live devtools in production, import from the /production entrypoint for your framework package: