react-patterns

Implement React component design patterns with TypeScript typings and usage guidelines.

1|Updated Nov 27, 2025
One-click install
npx skills add https://github.com/u9401066/medical-deidentification --skill react-patterns-u9401066
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-patterns
Source: https://github.com/u9401066/medical-deidentification/tree/main/.claude/skills/react-patterns
Command: npx skills add https://github.com/u9401066/medical-deidentification --skill react-patterns-u9401066

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Helps teams build scalable React UIs by codifying advanced patterns such as Compound Components, Render Props, Higher-Order Components, and Custom Hooks.

Core Features & Use Cases

  • Compound Components: coordinate multiple subcomponents with shared state and a clean API.
  • Render Props: expose internal logic/state to consumer components for flexible rendering.
  • Higher-Order Components (HOC): apply cross-cutting concerns like theming, logging, or auth without duplicating UI code.
  • Custom Hooks: extract reusable business and UI logic for reuse across components and apps.
  • Use Case: design a Tabs or Modal system where subcomponents compose to form a cohesive, maintainable pattern.

Quick Start

Create a small Tabs example using Compound Components and Render Props to demonstrate composable UI.

Frequently Asked Questions about react-patterns

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

FAQPage Schema
How do I build a scalable React Tabs component with composable subcomponents?

Build React Tabs using Compound Components to coordinate subcomponents with shared state. This pattern exposes a clean API, ensuring maintainability and reusability across UI libraries without tightly coupling internal logic to consumer rendering.

When should I use Render Props instead of Custom Hooks for React component design?

Use Render Props to expose internal component state to consumer components for flexible rendering. Use Custom Hooks to extract reusable business and UI logic, separating data behavior from UI structure entirely.

What is the best way to apply cross-cutting concerns like theming or auth in React?

Apply cross-cutting concerns like theming, logging, or auth using Higher-Order Components (HOC). HOCs wrap components to inject necessary logic without duplicating UI code, preserving reusability across your frontend design system.

How do I enforce clear boundaries and TypeScript typings in React UI libraries?

Enforce clear boundaries and TypeScript typings in React UI libraries by applying design patterns like Compound Components and Custom Hooks. These patterns require strict type definitions to ensure scalable and maintainable component APIs.

Why does my React component logic get duplicated across different UI modules?

React component logic gets duplicated when lacking reusable patterns. Extract shared business and UI logic into Custom Hooks or use Higher-Order Components to apply cross-cutting concerns, eliminating redundant code across frontend modules.

Does this React patterns approach require TypeScript for implementation?

Implementing these React patterns requires TypeScript typings, clear boundaries, and practical examples with usage guidelines. TypeScript ensures type safety and maintainability when applying Compound Components, Render Props, HOCs, and Custom Hooks.