vercel-composition-patterns

Guide React component composition with compound components and context providers.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Derlys/skillforge --skill vercel-composition-patterns-derlys
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/Derlys/skillforge/tree/main/.ruler/skills/vercel-composition-patterns
Command: npx skills add https://github.com/Derlys/skillforge --skill vercel-composition-patterns-derlys

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the complexity of managing React component states and props, preventing unmaintainable codebases and enabling more flexible, scalable component architectures.

Core Features & Use Cases

  • Component Architecture: Avoids boolean prop proliferation by promoting composition over conditional logic.
  • Compound Components: Enables building reusable UI pieces that share context without prop drilling.
  • State Management: Guides on decoupling state logic from UI and lifting state into providers for better accessibility.
  • React 19 APIs: Covers modern React practices like using use() instead of useContext() and handling refs.
  • Use Case: Refactor a large, monolithic UserProfile component with numerous boolean flags into smaller, composable components like UserProfileHeader, UserProfileSettings, and UserProfileActivityFeed, each managed by its own context provider.

Quick Start

Apply the 'Avoid Boolean Prop Proliferation' pattern to refactor the Composer component.

Frequently Asked Questions about vercel-composition-patterns

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

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

Compound components in React are reusable UI pieces that share context implicitly without prop drilling. Use them when building flexible component architectures that require decoupled state management across nested elements.

How do I refactor a monolithic React component into composable parts?

Refactor a monolithic React component by splitting it into smaller, composable parts like headers and activity feeds, lifting shared state into context providers to decouple state logic from the UI layer.

Does React 19 introduce new APIs for context and state management?

React 19 introduces modern API practices for context and state management, including using the `use()` hook instead of `useContext()` and updating ref handling to build scalable, maintainable component architectures.

What's the best way to manage state in scalable React applications?

The best way to manage state in scalable React applications is lifting state logic into context providers, decoupling it from the UI layer to prevent unmaintainable codebases and enable more flexible component architectures.

When should I not use context providers for React state management?

Avoid using context providers for React state management when component state is strictly local and lacks shared descendants, as unnecessary providers add complexity without benefiting the composition architecture.