vercel-composition-patterns

Replace boolean props with compound components and provider-based state in React.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

React components often become unwieldy due to boolean prop proliferation. This guide promotes explicit composition using compound components and provider-based state management to keep APIs scalable and maintainable.

Core Features & Use Cases

  • Encourages replacing boolean props with explicit component variants like ThreadComposer, EditMessageComposer, and ForwardMessageComposer
  • Advocates lifting state into providers to enable cross-component access and reuse
  • Covers architecture, state management, and implementation patterns for scalable React libraries

Quick Start

Create explicit component variants (ThreadComposer, EditMessageComposer, ForwardMessageComposer) from a base Composer.

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 composition in React components?

To replace boolean props in React components, create explicit component variants like ThreadComposer, EditMessageComposer, and ForwardMessageComposer from a base component. This compound component approach keeps APIs scalable and maintainable by avoiding prop proliferation.

What is the compound component pattern for scalable React architecture?

The compound component pattern for React architecture involves combining explicit component variants with provider-based state management. This approach lifts state into providers to enable cross-component access, ensuring robust and safe UI composition without unwieldy boolean props.

Does this React composition approach work with React 19 API guidance?

Yes, this React composition approach ensures compatibility with React 19 API guidance by applying use() over useContext and avoiding forwardRef. These patterns are explicitly designed to align with modern React 19 APIs for robust state management.

How do I lift state into providers for cross-component access in React?

To lift state into providers for React cross-component access, implement provider-based state management patterns. This allows sibling components within a compound component architecture to share and reuse state safely without excessive prop drilling.

When should I avoid using boolean props in React components?

You should avoid boolean props in React components when your API becomes unwieldy and difficult to maintain due to prop proliferation. Replacing them with explicit composition and component variants keeps the architecture scalable and the implementation robust.