vercel-composition-patterns

Refactor React components using compound components and React 19 features.

Updated Feb 26, 2026
One-click install
npx skills add https://github.com/christhz666/centro-diagnostico-v11 --skill vercel-composition-patterns-christhz666
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/christhz666/centro-diagnostico-v11/tree/main/.skills/composition-patterns
Command: npx skills add https://github.com/christhz666/centro-diagnostico-v11 --skill vercel-composition-patterns-christhz666

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the challenges of scaling React components by providing advanced composition techniques to avoid prop drilling, manage state effectively, and implement maintainable component architectures.

Core Features & Use Cases

  • Avoid Boolean Prop Proliferation: Use compound components and context to manage state and avoid complex prop logic.
  • State Management: Lift state into providers and define clear context interfaces for dependency injection.
  • Implementation Patterns: Implement compound components with shared context and prefer children over render props for cleaner composition.
  • React 19 APIs: Utilize React 19+ features like use() instead of useContext() and ref as a regular prop instead of forwardRef.

Quick Start

Apply the 'vercel-composition-patterns' skill to refactor a component with many boolean props into a more maintainable form using composition patterns.

Frequently Asked Questions about vercel-composition-patterns

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

FAQPage Schema
How do I avoid prop drilling in React components?

To avoid prop drilling in React components, use compound components with shared context to manage state and define clear context interfaces for dependency injection. This pattern lifts state into providers, preventing complex prop logic.

What is the best way to refactor a React component with too many boolean props?

The best way to refactor a React component with too many boolean props is applying advanced composition techniques. By implementing compound components, you can isolate state management and avoid complex boolean logic proliferation.

Can I use React 19 features to build scalable component architectures?

Yes, you can use React 19 features to build scalable component architectures by utilizing the use() hook instead of useContext() and passing ref as a regular prop instead of using forwardRef.

When should I prefer children over render props for React composition?

You should prefer children over render props for React composition to achieve cleaner component APIs. This advanced composition pattern enhances maintainability by utilizing shared context within compound components.

Does this React composition pattern work for building reusable component libraries?

Yes, this React composition pattern works for building reusable component libraries. It enhances maintainability and scalability by implementing advanced state management techniques and defining clear context interfaces for dependency injection.