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

react-flow-node-ts

Skill này làm gì

Công cụ này giúp tạo các thành phần hình ảnh cho React Flow. Nó cung cấp mẫu và hướng dẫn để bạn xây dựng các khối mới (gọi là “node”) một cách có tổ chức, với định nghĩa đúng.

Khi nào nên dùng

  • ✓Khi bạn cần tạo một loại khối hình ảnh mới cho sơ đồ.
  • ✓Khi thêm chức năng cụ thể cho một khối có sẵn.
  • ✓Để đảm bảo các khối trong sơ đồ tuân theo một mẫu nhất quán.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/react-flow-node-ts/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/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/react-flow-node-ts/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

“Tạo một node mới để hiển thị thông tin người dùng trong sơ đồ, với các trường tên và email.”

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

Cách hoạt động

Bạn sao chép các mẫu có sẵn và thay thế thông tin như tên khối và dữ liệu nó hiển thị. Sau đó, bạn làm theo các bước để tích hợp khối mới vào chương trình chính.

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.

Bundled upstream support

Supporting files are included at skill-relative paths. See UPSTREAM-NOTICE.md for their pinned sources, licenses, hashes, and import changes.

React Flow Node

Create React Flow node components following established patterns with proper TypeScript types and store integration.

Quick Start

Copy templates from assets/ and replace placeholders:

  • {{NodeName}} → PascalCase component name (e.g., VideoNode)
  • {{nodeType}} → kebab-case type identifier (e.g., video-node)
  • {{NodeData}} → Data interface name (e.g., VideoNodeData)

Templates

  • assets/template.tsx - Node component
  • assets/types.template.ts - TypeScript definitions

Node Component Pattern

export const MyNode = memo(function MyNode({
  id,
  data,
  selected,
  width,
  height,
}: MyNodeProps) {
  const updateNode = useAppStore((state) => state.updateNode);
  const canvasMode = useAppStore((state) => state.canvasMode);
  
  return (
    <>
      <NodeResizer isVisible={selected && canvasMode === 'editing'} />
      <div className="node-container">
        <Handle type="target" position={Position.Top} />
        {/* Node content */}
        <Handle type="source" position={Position.Bottom} />
      </div>
    </>
  );
});

Type Definition Pattern

export interface MyNodeData extends Record<string, unknown> {
  title: string;
  description?: string;
}

export type MyNode = Node<MyNodeData, 'my-node'>;

Integration Steps

  1. Add type to src/frontend/src/types/index.ts
  2. Create component in src/frontend/src/components/nodes/
  3. Export from src/frontend/src/components/nodes/index.ts
  4. Add defaults in src/frontend/src/store/app-store.ts
  5. Register in canvas nodeTypes
  6. Add to AddBlockMenu and ConnectMenu

When to Use

This skill is applicable to execute the workflow or actions described in the overview.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Câu hỏi thường gặp

“Node” trong React Flow là gì?

Node là các khối riêng lẻ tạo nên sơ đồ hoặc luồng trực quan trong ứng dụng React Flow.

“TypeScript types” nghĩa là gì?

TypeScript là ngôn ngữ giúp ngăn lỗi bằng cách định nghĩa rõ loại thông tin mà mỗi phần của code nhận hoặc trả về.

“Store integration” là gì?

Nghĩa là kết nối khối mới với hệ thống chính của ứng dụng để nó có thể lưu, lấy thông tin và tương tác với các khối khác.

Chi tiết

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

Create React Flow node components following established patterns with proper TypeScript types and store integration.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#5576
Giấy phép
MIT
Cập nhật
15/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ự