vercel-composition-patterns

Guide React component composition with compound components and state decoupling.

Updated Oct 20, 2025
One-click install
npx skills add https://github.com/pierregueroult/dot-files --skill vercel-composition-patterns-pierregueroult
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/pierregueroult/dot-files/tree/main/opencode/skills/vercel-composition-patterns
Command: npx skills add https://github.com/pierregueroult/dot-files --skill vercel-composition-patterns-pierregueroult

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the complexity of managing React components by providing patterns to avoid prop proliferation and create more maintainable, flexible, and scalable codebases.

Core Features & Use Cases

  • Component Architecture: Strategies to avoid boolean prop overload and embrace compound components.
  • State Management: Techniques for decoupling state from UI and lifting state into providers for better reusability.
  • Implementation Patterns: Guidance on explicit component variants and preferring children over render props.
  • React 19 APIs: Updates on new APIs like use() and ref handling.
  • Use Case: Refactor a large component with many conditional rendering paths into smaller, composable units that are easier to understand and maintain.

Quick Start

Apply the vercel-composition-patterns skill to refactor the Composer component in the current directory to use compound components and avoid boolean props.

Frequently Asked Questions about vercel-composition-patterns

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

FAQPage Schema
How do I avoid boolean prop proliferation in React components?

React composition patterns decouple state from UI by lifting state into providers, allowing components to remain flexible and reusable while avoiding the complexity of tightly coupled state management logic.

What is the best way to refactor a large React component with many conditional rendering paths?

The best way to refactor a large React component with many conditional rendering paths is to break it down into smaller, composable units using compound components, preferring children over render props for a more maintainable structure.

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

Yes, these React composition guidelines address React 19 API changes, including updates on new APIs like the use() hook and ref handling to ensure your component architecture remains compatible with the latest framework features.

When should I use compound components in my component architecture?

You should use compound components in your component architecture when you need to build scalable React components that require flexible assembly without prop overload, allowing parent components to implicitly share state with children cleanly.

Why should I prefer children over render props in React component design?

Preferring children over render props in React component design simplifies implementation patterns by making the component structure more explicit and easier to read, avoiding the nested callback complexity that render props often introduce.