devtools
它能做什么
这项技能展示如何把 Solid 表格注册到 TanStack Devtools 面板中,使开发者在构建时能检查它们。内容涵盖设置、必需的键和清理。
适用场景
- ✓当 Solid 表格没有出现在开发者工具面板中,你需要修复其注册的时候。
- ✓当你想在开发模式下运行应用时检查 Solid 表格的状态的时候。
- ✓当你想为某个特定表格开启或关闭开发者工具注册的时候。
技能链接
https://github.com/TanStack/table/blob/main/packages/solid-table-devtools/skills/devtools/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我在开发时如何在 TanStack 开发者工具面板中看到我的 Solid 表格?”
每周 5 个新技能,1 分钟读完。
工作原理
它解释如何在拥有表格的组件内,用唯一的键创建表格,在那里调用注册钩子,并在应用根部附近添加一个开发者工具宿主。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
This skill builds on @tanstack/table-core#core and @tanstack/table-devtools#devtools.
Setup
import { TanStackDevtools } from '@tanstack/solid-devtools'
import { createTable, tableFeatures } from '@tanstack/solid-table'
import {
tableDevtoolsPlugin,
useTanStackTableDevtools,
} from '@tanstack/solid-table-devtools'
const features = tableFeatures({})
export function App() {
const table = createTable({
key: 'users-table',
features,
columns: [],
data: [],
})
useTanStackTableDevtools(table)
return <TanStackDevtools plugins={[tableDevtoolsPlugin()]} />
}
Hooks and Components
Register inside the component's Solid owner. Pass { enabled } to the hook for conditional registration.
Common Mistakes
HIGH Registration created outside an owner
Wrong: call the Solid registration hook at module scope.
Correct: call it in the component that owns the table.
The hook uses Solid reactive cleanup to unregister the target.
Source: TanStack/table:packages/solid-table-devtools/src/useTanStackTableDevtools.ts
HIGH Missing or reused table key
Wrong: omit options.key or share one key between mounted tables.
Correct: assign a stable unique key per live table.
The target registry skips missing keys and replaces duplicate identities.
Source: TanStack/table:packages/table-devtools/src/tableTarget.ts
MEDIUM Production entrypoint assumed active
Wrong: expect normal Devtools exports to inspect a production table.
Correct: keep default guidance development-only; use /production only on explicit request.
The package index selects no-op implementations outside development.
Source: TanStack/table:packages/solid-table-devtools/src/index.ts
API Discovery
Inspect node_modules/@tanstack/solid-table-devtools/dist/index.d.ts, useTanStackTableDevtools.d.ts, and production.d.ts.
常见问题
我应该在哪里调用注册钩子?
应在拥有表格的组件内调用,而不是在模块作用域中,这样 Solid 才能正确地清理注册。
为什么我的表格没有列出?
没有键的表格会被跳过,因此每个正在运行的表格都需要一个稳定的唯一键。
我能只在某些情况下启用它吗?
可以,向钩子传入 enabled 选项即可实现有条件的注册。
详情
作者的原始描述
Connect Solid Table v9 instances to Devtools with tableDevtoolsPlugin and useTanStackTableDevtools in the proper reactive owner. Load for missing targets, required options.key, enabled state, cleanup, or development versus explicit production exports.
repo: TanStack/table
热度
- GitHub 星标
- 29k
- 排名
- #9827
- 许可证
- MIT
- 更新时间
- 2026/10/21
评论
- …
同一仓库的更多技能
getting-started
29k教你的智能体如何在 Alpine.js 中使用 TanStack Table 构建并显示数据表格,涵盖设置、响应式数据和渲染行。
table-state
29k教你的智能体如何在 Alpine.js 中读取和控制表格状态,例如当前页码,使状态变化时屏幕能够更新。
devtools
29k教你的智能体如何把 Angular 表格注册到 TanStack Devtools 面板中,使开发者在构建应用时能检查每个表格。
getting-started
29k教你的智能体如何在 Angular 中创建并显示 TanStack 表格,涵盖 injectTable 设置、模板渲染和行数据的更新。