Chuyển đến nội dung
Skillpedia
Website và giao diện (frontend)29k · #9823

devtools

Skill này làm gì

Skill này chỉ cách đăng ký bảng React với bảng điều khiển TanStack Devtools, để lập trình viên có thể kiểm tra chúng khi xây dựng. Skill bao quát thiết lập, các khóa bắt buộc và dọn dẹp.

Khi nào nên dùng

  • ✓Khi một bảng React bị thiếu trong bảng điều khiển devtools và bạn cần sửa việc đăng ký.
  • ✓Khi bạn muốn kiểm tra trạng thái bảng React khi ứng dụng chạy ở môi trường phát triển.
  • ✓Khi bạn cần hook devtools tuân theo quy tắc React thay vì được gọi có điều kiện.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/TanStack/table/blob/main/packages/react-table-devtools/skills/devtools/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Vì sao bảng React của tôi không hiện trong bảng điều khiển TanStack devtools?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill giải thích cách đặt cho bảng một khóa duy nhất, gọi hook đăng ký ngay sau khi tạo bảng, và thêm một host devtools gần gốc của ứng dụng.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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

Setup

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.

Câu hỏi thường gặp

Vì sao bảng của tôi bị devtools bỏ qua?

Bảng không có khóa sẽ bị bỏ qua, nên skill yêu cầu đặt một khóa duy nhất trước khi gọi hook.

Tôi có bật hoặc tắt đăng ký devtools được không?

Có. Truyền một tùy chọn enabled cho hook thay vì chỉ gọi nó trong một nhánh if.

Host devtools nên đặt ở đâu?

Gần gốc ứng dụng, một lần, với plugin devtools của bảng được thêm vào.

Chi tiết

Mô tả gốc của tác giả

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.

repo: TanStack/table

Độ phổ biến

Sao GitHub
29k
Vị trí xếp hạng
#9823
Giấy phép
MIT
Cập nhật
21/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự