vercel-composition-patterns

Refactor React component libraries by replacing boolean props with explicit variants and compound components.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/ldsgroups225/Yeko --skill vercel-composition-patterns-ldsgroups225
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/ldsgroups225/Yeko/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/ldsgroups225/Yeko --skill vercel-composition-patterns-ldsgroups225

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

React component design patterns address long-standing issues with boolean prop proliferation and scattered state logic, enabling scalable, maintainable libraries.

Core Features & Use Cases

  • Explicit component variants replace boolean flags to document intent and reduce branching.
  • Compound components with shared context enable flexible composition without prop drilling.
  • State management via providers and dependency injection keeps UI focused while logic migrates to dedicated providers.
  • Practical use cases include refactoring large component libraries and migrating to React 19 patterns.

Quick Start

Audit your components for boolean prop proliferation and refactor them into explicit variants and compound components using context providers.

Frequently Asked Questions about vercel-composition-patterns

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

FAQPage Schema
How do I eliminate boolean prop proliferation in React components?

Eliminate boolean prop proliferation by replacing boolean flags with explicit variant components. This refactoring documents intent, reduces branching logic, and creates maintainable React component libraries.

How do compound components use context to avoid prop drilling in React?

Compound components use shared context providers to enable flexible composition without prop drilling. This pattern allows parent components to implicitly share state with children, keeping UI focused and logic centralized.

What is the best way to refactor a large React component library for scalability?

The best way to refactor large React component libraries is auditing for boolean props, introducing explicit variants, and adopting compound component patterns. Migrating state logic to dedicated providers ensures scalable architecture.

Can I migrate React components to React 19 composition patterns?

Yes, you can migrate React components to React 19 patterns by applying explicit variants, compound components, and context providers. This guidance covers forward-looking API changes and state management for modernizing projects.

When should I use render-props versus compound components in React?

Use compound components with shared context when you need flexible composition without prop drilling. Render-props offer explicit variant logic, but compound patterns provide better scalability for large React component libraries.