vercel-composition-patterns

Refactor React components into explicit variants and provider-based architecture.

1|Updated Feb 11, 2026
One-click install
npx skills add https://github.com/victor-teles/oh-my-query --skill vercel-composition-patterns-victor-teles
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/victor-teles/oh-my-query/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/victor-teles/oh-my-query --skill vercel-composition-patterns-victor-teles

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Complex React components often become hard to maintain due to boolean prop proliferation and deeply nested conditional rendering. This skill provides a guideline to refactor with explicit variants, compound components, and context providers.

Core Features & Use Cases

  • Explicit component variants to replace boolean flags.
  • Compound components with shared context to avoid prop drilling.
  • State management via providers enabling UI reuse with different state implementations.
  • React 19 API considerations (use() over useContext, regular ref prop usage).

Quick Start

Refactor a monolithic React component into explicit variants and provider-based architecture.

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 to avoid boolean prop proliferation and prop drilling?

Refactor React components by replacing boolean flags with explicit variants and using compound components with shared context. This architecture reduces prop drilling and separates concerns effectively across your UI library.

What is the best way to scale a React app using composition patterns?

Scaling a React app with composition patterns involves applying explicit variants, compound components, and context interfaces. This approach replaces monolithic conditional rendering with provider-based state management for better UI reuse.

How do compound components and context providers work together in React 19?

Compound components and context providers work together in React 19 by sharing state through context interfaces without prop drilling. The React 19 API allows using the use() hook over useContext for cleaner provider-based state management.

Can I use render-props and compound components to refactor a monolithic React UI library?

Yes, you can refactor a monolithic React UI library using render-props and compound components. This technique establishes a clear separation of concerns, enabling explicit variants and provider-based state management for complex components.

Does this React composition pattern work with provider-based state management and different state implementations?

Yes, this composition pattern works with provider-based state management to enable UI reuse with different state implementations. Context interfaces and compound components allow you to swap state logic without altering the component structure.