本文へスキップ
Skillpedia
WebサイトとUI(フロントエンド)29k · #9819

devtools

できること

このスキルは、Preactの表をTanStack Devtoolsのパネルに登録する方法を示します。開発者は作りながら表を確認できます。開発中に表の状態を見たいPreactの開発者向けです。

使う場面

  • ✓開発中にアプリを動かしながら、Preactの表の状態を調べたいとき。
  • ✓表がdevtoolsパネルにない場合に、その登録を確認する必要があるとき。
  • ✓ReactとPreactのパッケージが混在し、devtoolsが正しく接続しないとき。

スキルのリンク

https://github.com/TanStack/table/blob/main/packages/preact-table-devtools/skills/devtools/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/TanStack/table/blob/main/packages/preact-table-devtools/skills/devtools/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“Preactの表がTanStackのdevtoolsパネルに表示されません。どう接続すればよいですか。”

毎週5つの新しいスキル。1分で読めます。

仕組み

一意のキーを付けて表を作り、Preactのフックで登録し、アプリのルート近くでdevtoolsのプラグインを一度追加する方法を説明します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

This skill builds on @tanstack/table-core#core and @tanstack/table-devtools#devtools.

Setup

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.

よくある質問

なぜ各表にキーが必要なのですか?

キーのない表はスキップされ、同じキーを持つ2つの表はパネルで互いに置き換わってしまいます。

登録のオン・オフを切り替えられますか?

はい、フックはenabledのオプションを受け取るので、呼び出しを削除せずにオフにできます。

PreactのアプリでReactのdevtoolsのパッケージを使うべきですか?

いいえ、互換のエイリアスを通じてReactのパッケージを使わず、ネイティブのPreactのパッケージを使うようスキルは述べています。

詳細

作者による元の説明

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.

repo: TanStack/table

人気

GitHubのスター
29k
ランキング
#9819
ライセンス
MIT
更新日
2026/10/21

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル