vercel-composition-patterns

Guide React composition patterns for scalable components with compound components and context.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill addresses the complexity of building maintainable and scalable React components by providing patterns to avoid prop proliferation and improve code organization.

Core Features & Use Cases

  • Component Architecture: Strategies to avoid boolean prop hell and utilize compound components effectively.
  • State Management: Guidance on lifting state, decoupling implementations, and defining generic context interfaces.
  • Implementation Patterns: Best practices for composing components using children over render props and creating explicit variants.
  • Use Case: Refactor a large, monolithic React component with numerous conditional rendering paths into a more modular and maintainable structure using compound components and explicit variants.

Quick Start

Apply the vercel-composition-patterns skill to refactor the Composer component to use explicit variants instead of boolean props.

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 a React component to avoid boolean prop proliferation?

React compound components solve boolean prop hell by splitting a monolithic component into modular sub-components. This architecture pattern replaces multiple conditional rendering paths with explicit variants, improving maintainability and scalability.

What is the best way to manage shared state across multiple React sub-components?

The best way to manage shared state in React composition is by lifting it into a provider and defining a generic context interface. This decouples implementations and provides dependency injection across your component tree.

Why should I prefer children over render props in React component architecture?

Preferring children over render props in React component architecture reduces nesting complexity and improves code readability. This composition pattern keeps component structures flat and explicit, avoiding callback hell within your JSX.

Does this React composition approach support React 19 API changes for refs and context?

Yes, this React composition approach explicitly includes React 19 API changes for refs and context. It provides guidance on defining generic context interfaces and adapting component architecture to the latest framework standards.

When should I use explicit component variants instead of conditional rendering?

You should use explicit React component variants instead of conditional rendering when a single component has numerous boolean props controlling its appearance. This refactoring strategy creates dedicated, modular components for each visual state.