vercel-composition-patterns

Refactor React components with boolean props into explicit variant components.

Updated Apr 18, 2026
One-click install
npx skills add https://github.com/sammy9322/ventura-dental-facturacion --skill vercel-composition-patterns-sammy9322
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/sammy9322/ventura-dental-facturacion/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/sammy9322/ventura-dental-facturacion --skill vercel-composition-patterns-sammy9322

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the common pain point of unmaintainable React codebases caused by excessive boolean props, monolithic component structures, and tightly coupled state management that makes refactoring, reuse, and scaling difficult.

Core Features & Use Cases

  • Eliminates boolean prop proliferation by using explicit component variants instead of conditional mode flags
  • Implements compound components with shared context for flexible, prop-drill-free composition
  • Provides patterns for lifting state into providers to enable dependency injection and cross-component state access
  • Includes guidance for React 19 API updates like replacing forwardRef and useContext with modern equivalents
  • Use Case: Refactor a chat application's message composer that uses 6+ boolean props for threads, edits, and forwards into explicit, reusable variant components.

Quick Start

Request refactoring of your existing React component with multiple boolean mode props into explicit, composable variant components using the patterns defined in this Skill.

Frequently Asked Questions about vercel-composition-patterns

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

FAQPage Schema
How do I refactor React components with too many boolean props?

React composition patterns solve prop bloat by replacing conditional boolean flags with explicit, reusable variant components. This refactoring approach breaks monolithic structures into composable pieces using shared context providers.

What are compound components in React and how do they manage state?

Compound components in React are an architectural pattern using shared context to manage state without prop drilling. This pattern enables flexible composition and dependency-injectable state access across decoupled UI components.

How do I implement dependency injection for state management in React?

Dependency injection for React state management is implemented by lifting state logic into context providers. This decouples state from the component tree, enabling cross-component access without tightly coupled props or prop drilling.

Does this React composition approach align with React 19 API best practices?

Yes, these React composition patterns align with React 19 API best practices by replacing legacy forwardRef and useContext implementations with modern equivalents. This ensures refactored component libraries remain compatible with current React updates.

When should I avoid using boolean props in React component libraries?

You should avoid boolean props in React component libraries when they cause excessive conditional logic and tight coupling. If a component requires multiple boolean flags for modes like editing or threading, explicit variants provide better maintainability.