vercel-composition-patterns

Replace boolean props with React composition patterns and shared context.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

React applications often suffer from boolean prop proliferation that leads to numerous conditional branches and fragile component APIs. This Skill provides a structured approach to design scalable UI by embracing composition patterns, compound components, and context-driven APIs, reducing complexity and improving reusability across teams.

Core Features & Use Cases

  • Use compound components to share state via a single context without prop drilling.
  • Lift state into providers to enable UI pieces to be reused across different contexts.
  • Replace boolean props with explicit component variants to improve readability and maintainability.
  • Address React 19 API changes (use() instead of useContext) when modernizing codebases.

Quick Start

Start refactoring by replacing boolean props in existing components with dedicated Variant components that compose shared internals and rely on a provider for state management.

Frequently Asked Questions about vercel-composition-patterns

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

FAQPage Schema
How do I replace boolean props with explicit variants in React components?

Compound components share state via a single context provider without prop drilling by lifting state into providers, enabling individual UI pieces to be reused across different contexts while maintaining synchronized internal state.

How do compound components share state without prop drilling in React?

Compound components share state via a single context provider without prop drilling by lifting state into providers, enabling individual UI pieces to be reused across different contexts while maintaining synchronized internal state.

Does this React composition pattern approach support React 19 API changes?

Yes, the composition pattern approach supports React 19 API changes by enforcing the use of the use() hook instead of useContext when modernizing codebases, ensuring context-driven APIs remain compatible with updated React APIs.

What's the best way to scale React UI library architecture for team reuse?

The best way to scale React UI library architecture is embracing composition patterns, compound components, and context-driven APIs to reduce complexity, eliminate boolean prop proliferation, and improve reusability across teams.

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

You should avoid using boolean props in React component APIs when they cause prop proliferation that leads to numerous conditional branches and fragile component APIs, replacing them with explicit variants to improve readability and maintainability.