vercel-composition-patterns

Guide React component composition with compound components and context.

Updated Jun 20, 2026
One-click install
npx skills add https://github.com/sbsbhong/diving-app --skill vercel-composition-patterns-sbsbhong
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/sbsbhong/diving-app/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/sbsbhong/diving-app --skill vercel-composition-patterns-sbsbhong

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill addresses the challenge of managing complex React applications by providing a set of scalable and maintainable composition patterns, reducing prop drilling and improving state management.

Core Features & Use Cases

  • Component Architecture: Guidelines to avoid prop drilling and use compound components.
  • State Management: Best practices for lifting state, defining context interfaces, and decoupling state from UI.
  • Implementation Patterns: Techniques for explicit component variants and preferred use of children over render props.
  • React 19 APIs: Compatibility notes for using use() instead of forwardRef and useContext().

Quick Start

Apply the vercel-composition-patterns Skill to refactor your React components, improving their maintainability and scalability.

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 prop drilling in React components?

Avoiding prop drilling in React involves applying compound components and React context to pass state directly to nested children, bypassing intermediate layers and improving maintainability.

What is the best way to decouple state management from UI in React?

Decoupling state management from UI in React involves lifting state appropriately and defining clear context interfaces, allowing components to remain flexible and scalable without tightly binding logic to presentation.

How do I use the React 19 use API instead of useContext for composition?

For React 19 composition, you use the `use()` API instead of `useContext()` and `forwardRef` to read context values directly within components, ensuring compatibility with modern React application patterns.

When should I use children over render props in React composition patterns?

You should prefer using children over render props in React composition patterns to achieve explicit component variants, which simplifies the component architecture and enhances overall code readability.

Does this React composition guidance apply to scalable applications?

Yes, this React composition guidance targets scalable applications by providing structural patterns for component architecture and state management, ensuring maintainability and flexibility as modern applications grow.