react-component-design

Design React components with Tetris architecture guidelines for structure and performance.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/sakataka/tetris-game2 --skill react-component-design
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-component-design
Source: https://github.com/sakataka/tetris-game2/tree/main/.claude/skills/react-component-design
Command: npx skills add https://github.com/sakataka/tetris-game2 --skill react-component-design

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams design scalable, reusable React components for the Tetris project, reducing duplication and improving maintainability.

Core Features & Use Cases

  • Component Consolidation: Prefer unified components over excessive fragmentation
  • Functional Components: No class components
  • Custom Hooks: Extract reusable logic
  • Type Aliases: Use type instead of interface for props
  • Dynamic IDs: Use useId() hook for accessibility
  • Optimized Patterns: Minimize re-renders and prop drilling

Quick Start

Create a new component following the Basic Component Template described in the guide. For example, implement a reusable button with localization and accessibility.

Frequently Asked Questions about react-component-design

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design React components that minimize re-renders and prop drilling?

Design React components using functional components with custom hooks to extract reusable logic, type aliases for props, and the useId hook for accessibility. This pattern consolidates logic, reduces unnecessary re-renders, eliminates prop drilling, and maintains consistency across your component library.

When should I use custom hooks instead of prop drilling in React?

Use custom hooks to extract reusable logic and share state across components without passing props through intermediate layers. Custom hooks encapsulate logic, improve component readability, reduce prop drilling, and make logic testable and reusable across your React application.

What's the best way to structure accessible React components with dynamic IDs?

Use React's useId hook to generate unique, stable IDs for form inputs, labels, and ARIA attributes instead of manual ID management. This approach ensures accessibility compliance, prevents ID collisions in server-rendered or dynamically rendered components, and simplifies component composition.

Should I use type aliases or interfaces for React component props?

Use type aliases instead of interfaces for defining React component props. Type aliases provide better union support, clearer prop composition, improved TypeScript integration with component libraries, and consistency with modern React typing patterns.

How do I consolidate fragmented React components into unified patterns?

Consolidate multiple similar components into single, flexible components by extracting common logic into custom hooks, using type aliases for variant props, and applying consistent patterns. This reduces duplication, improves maintainability, simplifies refactoring, and creates a scalable component architecture.

Why avoid class components when designing modern React component systems?

Functional components with hooks provide clearer logic composition, better code reuse through custom hooks, simpler testing, smaller bundle sizes, and alignment with modern React patterns. Functional components eliminate class complexity while maintaining all necessary lifecycle and state management capabilities.