react-patterns

Guide React component architecture with compound components, render props, and polymorphic patterns.

Updated Jan 26, 2026
One-click install
npx skills add https://github.com/theofernandezz/ai-library --skill react-patterns-theofernandezz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-patterns
Source: https://github.com/theofernandezz/ai-library/tree/main/.opencode/skills/react-patterns
Command: npx skills add https://github.com/theofernandezz/ai-library --skill react-patterns-theofernandezz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

React component design and state management can become repetitive and hard to maintain as apps grow. This Skill provides battle-tested patterns, hooks design, and composition techniques to help you build scalable UIs with fewer bugs and easier maintenance.

Core Features & Use Cases

  • Component patterns: Compound components, render props, and polymorphic components to improve reusability and flexibility.
  • Hooks design: Patterns for data loading, debouncing, and orchestrating state across components.
  • Architecture guidance: Clear guidance on organizing components, hooks, and features for scalable frontend architectures.

Quick Start

Create a reusable Card component using Compound Components to demonstrate flexible structure.

Frequently Asked Questions about react-patterns

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

FAQPage Schema
What are compound components in React and when should I use them?

Compound components in React are a pattern allowing flexible UI composition by letting parent components implicitly share state with children, ensuring maintainability and reducing repetitive boilerplate as your app grows.

How do I design scalable React hooks for data loading and state orchestration?

To design scalable React hooks, apply modern patterns for data loading, debouncing, and state orchestration across components. This approach ensures consistent state management and reduces bugs in large frontend architectures.

What is the best way to structure a React component library for maintainability?

The best way to structure a React component library is applying proven patterns like polymorphic components and render props, which provides clear guidance on organizing features and hooks for scalable frontend architectures.

Can I use TypeScript with these React component patterns?

Yes, TypeScript works directly with these React component patterns. The architecture guidance promotes strict adherence to patterns like compound components and polymorphic components to ensure type safety and consistency across your UI.

When should I avoid render props in my React architecture?

You should avoid render props in your React architecture when simpler composition patterns achieve the same result, as overusing them can create callback hell and reduce code readability in scalable frontend applications.