首页/前端开发/react-component-architecture
R

react-component-architecture

by @aj-geddesv1.0.0
0.0(0)

Design scalable React components using functional components, hooks, composition patterns, and TypeScript. Use when building reusable component libraries and maintainable UI systems.

React.jsComponent DesignFrontend ArchitectureState ManagementGitHub
安装方式
npx skills add aj-geddes/useful-ai-prompts --skill react-component-architecture
compare_arrows

Before / After 效果对比

0

description 文档


name: react-component-architecture description: > Design scalable React components using functional components, hooks, composition patterns, and TypeScript. Use when building reusable component libraries and maintainable UI systems.

React Component Architecture

Table of Contents

Overview

Build scalable, maintainable React components using modern patterns including functional components, hooks, composition, and TypeScript for type safety.

When to Use

  • Component library design
  • Large-scale React applications
  • Reusable UI patterns
  • Custom hooks development
  • Performance optimization

Quick Start

Minimal working example:

// Button.tsx
import React, { useState, useCallback } from 'react';

interface ButtonProps {
  variant?: 'primary' | 'secondary' | 'danger';
  size?: 'sm' | 'md' | 'lg';
  disabled?: boolean;
  onClick?: () => void;
  children: React.ReactNode;
}

export const Button: React.FC<ButtonProps> = ({
  variant = 'primary',
  size = 'md',
  disabled = false,
  onClick,
  children
}) => {
  const variantStyles = {
    primary: 'bg-blue-500 hover:bg-blue-600',
    secondary: 'bg-gray-500 hover:bg-gray-600',
    danger: 'bg-red-500 hover:bg-red-600'
  };

  const sizeStyles = {
// ... (see reference guides for full implementation)

Reference Guides

Detailed implementations in the references/ directory:

| Guide | Contents | |---|---| | Functional Component with Hooks | Functional Component with Hooks | | Custom Hooks Pattern | Custom Hooks Pattern | | Composition Pattern | Composition Pattern | | Higher-Order Component (HOC) | Higher-Order Component (HOC) | | Render Props Pattern | Render Props Pattern |

Best Practices

✅ DO

  • Follow established patterns and conventions
  • Write clean, maintainable code
  • Add appropriate documentation
  • Test thoroughly before deploying

❌ DON'T

  • Skip testing or validation
  • Ignore error handling
  • Hard-code configuration values

forum用户评价 (0)

发表评价

效果
易用性
文档
兼容性

暂无评价,来写第一条吧

统计数据

安装量0
评分0.0 / 5.0
版本1.0.0
更新日期2026年3月17日
对比案例0 组

用户评分

0.0(0)
5
0%
4
0%
3
0%
2
0%
1
0%

为此 Skill 评分

0.0

兼容平台

🔧Claude Code

时间线

创建2026年3月17日
最后更新2026年3月17日