vercel-composition-patterns

Refactors React components using compound components, context providers, and composition patterns.

Updated Aug 28, 2026
One-click install
npx skills add https://github.com/AnderHonorato/Mem-rias-IA---Infinity --skill vercel-composition-patterns-anderhonorato
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/AnderHonorato/Mem-rias-IA---Infinity/tree/main/Manus/Skills/snapshots/vercel-composition-patterns
Command: npx skills add https://github.com/AnderHonorato/Mem-rias-IA---Infinity --skill vercel-composition-patterns-anderhonorato

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 to replace prop proliferation with composition, making component codebases easier to maintain and extend. ## 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. - Explicit Variants and React 19 APIs: Create self-documenting variant components instead of boolean modes, and apply React 19 changes like ref-as-prop and use() instead of useContext(). - Use Case: When refactoring a Composer component overloaded with isThread, isEditing, and isForwarding flags, apply these rules to split it into ThreadComposer, EditComposer, and ForwardMessageComposer variants sharing compound internals. ## Quick Start Ask the AI to refactor a React component with many boolean props into compound components using the composition patterns 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?

Replace boolean props with composition by creating explicit variant components like ThreadComposer or EditComposer. Each variant composes shared compound component pieces, eliminating conditional logic and impossible states.

What are compound components in React?

Compound components are structured as a parent provider with subcomponents that access shared state via context instead of props. Consumers compose exactly the pieces they need, such as Composer.Frame, Composer.Input, and Composer.Submit.

When should I use children instead of render props in React?

Use children when composing static structure because they are more readable and compose naturally. Use render props only when the parent needs to pass data or state back to the child, such as rendering list items.

Does React 19 still require forwardRef?

No, in React 19 ref is a regular prop, so the forwardRef wrapper is no longer needed. Additionally, use() replaces useContext() and can be called conditionally, unlike useContext.

How do I share React component state with sibling components outside the UI?

Lift state into a provider component so any component within the provider boundary can access state and actions via context. Components do not need to be visually nested inside the main UI, only within the same provider.