Skip to main content

devtools

Connect native Preact Table v9 instances to Devtools with tableDevtoolsPlugin and useTanStackTableDevtools. Load for React-package mixups, missing targets, required options.key, enabled state, cleanup, or development gating.

来源信息

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

安装方式

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

检查来源文件

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

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
devtools
description
Connect native Preact Table v9 instances to Devtools with tableDevtoolsPlugin and useTanStackTableDevtools. Load for React-package mixups, missing targets, required options.key, enabled state, cleanup, or development gating.
metadata
{"type":"framework","library":"@tanstack/preact-table-devtools","framework":"preact","library_version":"9.3.0"}
requires
["@tanstack/table-core#core","@tanstack/table-devtools#devtools"]
sources
["TanStack/table:docs/devtools.md","TanStack/table:packages/preact-table-devtools/src/index.ts","TanStack/table:packages/preact-table-devtools/src/useTanStackTableDevtools.ts"]
This skill builds on @tanstack/table-core#core and @tanstack/table-devtools#devtools. ## Setup ```tsx import { TanStackDevtools } from '@tanstack/preact-devtools' import { useTable, tableFeatures } from '@tanstack/preact-table' import { tableDevtoolsPlugin, useTanStackTableDevtools, } from '@tanstack/preact-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 the native Preact packages throughout. Pass `{ enabled }` rather than conditionally calling the registration hook. ## Common Mistakes ### HIGH React Devtools package mixed into Preact Wrong: import the hook from `@tanstack/react-table-devtools` through compat. Correct: use `@tanstack/preact-table-devtools` with `@tanstack/preact-devtools`. The native adapter owns Preact effect lifecycle and plugin types. Source: TanStack/table:docs/devtools.md ### HIGH Missing or duplicate key Wrong: omit `key` or reuse `users-table` for multiple mounted tables. Correct: give each live table one stable unique key. Keyless registration is skipped; duplicate keys replace targets. Source: TanStack/table:packages/table-devtools/src/tableTarget.ts ### MEDIUM Production no-op mistaken for failure Wrong: expect the default entrypoint to stay active in a production bundle. Correct: keep Devtools development-only unless an explicit production import is required. The default index deliberately selects no-op implementations outside development. Source: TanStack/table:packages/preact-table-devtools/src/index.ts ## API Discovery Inspect `node_modules/@tanstack/preact-table-devtools/dist/index.d.ts` and `useTanStackTableDevtools.d.ts`; do not copy React adapter imports.
在 GitHub 查看