Skip to main content

devtools

Connect React Table v9 instances to Devtools with tableDevtoolsPlugin and useTanStackTableDevtools. Load for missing Table panels, registration lifecycle, required options.key, enabled state, or development versus explicit production exports.

来源信息

仓库
TanStack/table
最近来源活动
2026年10月8日 21:31
检测到的 SKILL.md 语言
英语
星标
28,480
分支
3,587

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
devtools
description
Connect React Table v9 instances to Devtools with tableDevtoolsPlugin and useTanStackTableDevtools. Load for missing Table panels, registration lifecycle, required options.key, enabled state, or development versus explicit production exports.
metadata
{"type":"framework","library":"@tanstack/react-table-devtools","framework":"react","library_version":"9.2.8"}
requires
["@tanstack/table-core#core","@tanstack/table-devtools#devtools"]
sources
["TanStack/table:docs/devtools.md","TanStack/table:packages/react-table-devtools/src/index.ts","TanStack/table:packages/react-table-devtools/src/useTanStackTableDevtools.ts"]
This skill builds on @tanstack/table-core#core and @tanstack/table-devtools#devtools. ## Setup ```tsx import { TanStackDevtools } from '@tanstack/react-devtools' import { useTable, tableFeatures } from '@tanstack/react-table' import { tableDevtoolsPlugin, useTanStackTableDevtools, } from '@tanstack/react-table-devtools' const features = tableFeatures({}) const columns = [{ accessorKey: 'id' }] const data: Array<{ id: string }> = [] export function App() { const table = useTable({ key: 'users-table', features, columns, data, }) useTanStackTableDevtools(table) return <TanStackDevtools plugins={[tableDevtoolsPlugin()]} /> } ``` ## Hooks and Components Use `useTanStackTableDevtools(table, { enabled })` immediately after creating the table. Mount one TanStackDevtools host with `tableDevtoolsPlugin()` near the application root. ## Common Mistakes ### HIGH Hook receives a keyless table Wrong: create the table without `key` and expect the hook to infer a name. Correct: set a unique `key` in table options before calling the hook. Core target registration skips keyless tables. Source: TanStack/table:docs/devtools.md ### HIGH Hook called conditionally Wrong: call `useTanStackTableDevtools` only inside an `if` branch. Correct: call it every render and pass `{ enabled: condition }`. The hook owns React effect registration and cleanup. Source: TanStack/table:packages/react-table-devtools/src/useTanStackTableDevtools.ts ### MEDIUM Default import expected in production Wrong: expect the normal hook/plugin/panel to inspect production tables. Correct: keep normal guidance development-only; use the `/production` entrypoint only when explicitly required. The default index selects no-op implementations outside development. Source: TanStack/table:packages/react-table-devtools/src/index.ts ## API Discovery Inspect `node_modules/@tanstack/react-table-devtools/dist/index.d.ts` and `useTanStackTableDevtools.d.ts` for the installed lifecycle API.
在 GitHub 查看