vercel-composition-patterns

Guide React component composition with patterns for scalable architecture.

Updated Mar 12, 2026
One-click install
npx skills add https://github.com/WesleyMarinho/codeseek-marketplace --skill vercel-composition-patterns-wesleymarinho
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/WesleyMarinho/codeseek-marketplace/tree/main/skills/vercel-composition-patterns
Command: npx skills add https://github.com/WesleyMarinho/codeseek-marketplace --skill vercel-composition-patterns-wesleymarinho

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill addresses the complexity and maintainability issues that arise in React component architecture, particularly when dealing with numerous conditional props or intricate state management.

Core Features & Use Cases

  • Component Architecture: Guides on avoiding boolean prop proliferation and utilizing compound components for cleaner, more flexible UIs.
  • State Management: Strategies for decoupling state logic, defining generic context interfaces, and lifting state effectively.
  • Use Case: Refactor a large, monolithic Composer component that uses many boolean props into a set of explicit, composable components like ThreadComposer, EditMessageComposer, and ForwardMessageComposer, each with its own clear purpose and state management.

Quick Start

Apply React composition patterns to refactor a component with excessive boolean props by composing explicit variants.

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?

Refactor React components with excessive boolean props by replacing conditional logic with explicit, composable variants like ThreadComposer or EditMessageComposer. This composition pattern separates concerns, giving each component a clear purpose and independent state management for better maintainability.

What are compound components in React and when should I use them?

Compound components in React are an architecture pattern combining smaller, explicit sub-components into a flexible UI. Use them to decouple state management and avoid prop drilling, allowing parent components to share context implicitly without passing multiple boolean props down the tree.

How do React 19 API changes affect refs and context?

React 19 API changes introduce specific patterns for handling refs and context, moving away from forwardRef and updating how context is provided. This Skill provides targeted guidelines to adapt your component architecture and define generic context interfaces using these new APIs.

What is the best way to decouple state management in scalable React components?

The best way to decouple state management in scalable React components is lifting state effectively and defining generic context interfaces. This isolates state logic from presentational components, preventing monolithic structures and ensuring each component variant manages its own state independently.

Can I use these React composition patterns with TypeScript?

Yes, these React composition patterns are fully compatible with TypeScript. The Skill provides guidelines for defining generic context interfaces and typing explicit component variants, ensuring your decoupled state management and compound components remain strictly type-safe.