vercel-composition-patterns

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? React components accumulate boolean props like isThread or isEditing that create exponential state combinations and unmaintainable conditional logic. This Skill provides structured rules for replacing prop proliferation with composition patterns. ## Core Features & Use Cases - Compound Component Architecture: Structure complex components with shared context so consumers compose only the pieces they need. - State Lifting & Dependency Injection: Define generic context interfaces (state, actions, meta) so the same UI works with any state implementation. - React 19 API Guidance: Replace forwardRef with ref-as-prop and useContext() with use(). - Use Case: When refactoring a messaging composer that has grown to accept six boolean props, apply these rules to split it into explicit variants like ThreadComposer and EditComposer sharing compound internals. ## Quick Start Refactor this React component that uses boolean props into compound components with a shared context provider following the composition rules.

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 explicit variant components that compose shared internals. Create separate components like ThreadComposer and EditComposer, each composing only the pieces it needs from a compound component structure.

What are compound components in React?▼

Compound components are a pattern where a parent component shares state via context with its subcomponents, like Composer.Frame and Composer.Input. Consumers compose exactly the pieces they need without prop drilling or hidden conditionals.

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

Use children for composing static structure since they are more readable and compose naturally. Reserve render props for cases where the parent must pass data back to the child, such as list item rendering.

Does forwardRef still work in React 19?▼

React 19 makes ref a regular prop, so forwardRef wrappers are no longer needed. You can also replace useContext() with the use() hook, which additionally supports conditional calls.

When should I lift state into a React provider component?▼

Lift state into a provider when sibling components outside the main UI need access to that state or its actions. This avoids prop drilling, useEffect syncing, and ref-based workarounds for cross-component communication.