vercel-composition-patterns

Guides refactoring of React components using compound components, context providers, and composition patterns.

Updated May 28, 2026
One-click install
npx skills add https://github.com/qbstabletampa-creator/firmware-foundation-studios --skill vercel-composition-patterns-qbstabletampa-creator
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/qbstabletampa-creator/firmware-foundation-studios/tree/main/archive/apps/manna-catch/.agents/skills/composition-patterns
Command: npx skills add https://github.com/qbstabletampa-creator/firmware-foundation-studios --skill vercel-composition-patterns-qbstabletampa-creator

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? React components often accumulate boolean props like isThread or isEditing, creating exponential state combinations and unmaintainable conditional logic. This Skill provides structured patterns for replacing prop proliferation with composition, making component codebases easier to maintain and scale. ## Core Features & Use Cases - Compound Component Architecture: Structure complex components with shared context so consumers compose exactly the pieces they need. - State Lifting and Dependency Injection: Move state into provider components with generic state/actions/meta interfaces, letting the same UI work with different state implementations. - React 19 API Guidance: Covers ref as a regular prop and use() replacing useContext() for React 19+ codebases. - Use Case: When refactoring a Composer component overloaded with isThread, isEditing, and isForwarding flags, apply these rules to split it into explicit ThreadComposer, EditComposer, and ForwardMessageComposer variants sharing compound internals. ## Quick Start Ask the AI to refactor a React component that has too many boolean props into compound components with a shared context provider.

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?▼

Replace boolean props with composition by creating explicit variant components like ThreadComposer or EditComposer. Each variant composes shared compound component pieces, eliminating exponential state combinations and hidden conditionals.

What are compound components in React?▼

Compound components are structured around a shared context where subcomponents access state via context instead of props. Consumers explicitly compose the pieces they need, such as Composer.Frame, Composer.Input, and Composer.Submit.

Should I use children or render props for React composition?▼

Prefer children for composing static structure since they are more readable and compose naturally. Use render props only when the parent needs to pass data back to the child, such as renderItem in a list.

Does forwardRef still work in React 19?▼

In React 19, ref is a regular prop, so the forwardRef wrapper is no longer needed. The use() hook also replaces useContext() and can be called conditionally, unlike useContext().

How do I share React state between sibling components without prop drilling?▼

Lift state into a dedicated provider component that wraps the siblings. Any component within the provider boundary can access state and actions via context, even if it is not visually nested inside the main UI.

When should I not use compound components?▼

Compound components add context and provider overhead, so they are unnecessary for simple components with few variations. They are most valuable when a component has multiple variants or needs dependency-injectable state across use cases.