vercel-composition-patterns

Guide React composition patterns for scalable component architectures.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/mnadalc/dotfiles --skill vercel-composition-patterns-mnadalc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/mnadalc/dotfiles/tree/main/.ai/skills/react-composition-patterns
Command: npx skills add https://github.com/mnadalc/dotfiles --skill vercel-composition-patterns-mnadalc

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill addresses the complexity of building maintainable and scalable React components by providing patterns to avoid prop proliferation and enable flexible composition.

Core Features & Use Cases

  • Component Architecture: Patterns to avoid boolean prop proliferation and use compound components effectively.
  • State Management: Techniques for lifting state and managing shared context across components.
  • Implementation Patterns: Best practices for creating explicit component variants and preferring children over render props.
  • Use Case: Refactor a large, monolithic Composer component with numerous boolean props into smaller, composable components like ThreadComposer, EditComposer, and ForwardMessageComposer for improved readability and maintainability.

Quick Start

Apply the architecture-avoid-boolean-props rule to refactor the provided Composer component.

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 a React component with too many boolean props?

To refactor a React component with too many boolean props, apply composition patterns to split the monolithic structure into smaller, explicit variants like ThreadComposer or EditComposer. This avoids prop proliferation and improves maintainability by using compound components.

What is the best way to manage shared state across compound components in React?

The best way to manage shared state across compound components in React is by lifting state and utilizing providers. This technique manages shared context effectively without passing props deeply, ensuring scalable component architecture.

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

Yes, this React composition approach works with React 19 API changes. It specifically addresses updates including the new use() hook and ref handling, ensuring your component architecture patterns remain compatible with the latest React API.

Should I use render props or children for explicit React component variants?

You should prefer using children over render props for explicit React component variants. This composition pattern provides better readability and maintainability, allowing you to build scalable React components without complex render prop logic.

When should I avoid using boolean props in React component architecture?

You should avoid using boolean props in React component architecture when a single component handles multiple distinct use cases. Instead of adding boolean flags, split the component into smaller, composable components to prevent prop proliferation and improve readability.