vercel-composition-patterns

Refactor React components using compound components, render props, and context providers.

45|4|Updated Sep 22, 2016
One-click install
npx skills add https://github.com/f0rr0/f0rr0.github.io --skill vercel-composition-patterns-f0rr0
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/f0rr0/f0rr0.github.io/tree/main/.rulesync/skills/vercel-composition-patterns
Command: npx skills add https://github.com/f0rr0/f0rr0.github.io --skill vercel-composition-patterns-f0rr0

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.

Core Features & Use Cases

  • Patterns for structuring reusable UI primitives and scalable APIs
  • Techniques for compound components, render props, and context-based interfaces
  • Guidance for evolving codebases to accommodate React 19 API changes and large-scale UI libraries

Quick Start

Refactor a boolean-prop heavy component into explicit variants wrapped with providers to scale your UI.

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?

Compound components in React let you structure flexible UI primitives by grouping related parts. They leverage context providers to share state implicitly, creating reusable component library APIs without prop drilling.

What is the best way to structure scalable React composition patterns?

React 19 API changes affect context providers by refining state management and component architecture. Refactoring to explicit variants wrapped with providers ensures your UI library accommodates these new API changes effectively.

When do I need context providers for React UI libraries?

You need context providers for React UI libraries when building reusable APIs and flexible component architectures. They enable dependency-injection friendly structures, replacing boolean prop proliferation with explicit variant management.

Can I use render props to scale React component architecture?

You can use render props to scale React component architecture by passing functions as props to share state and logic. This pattern builds explicit variants and flexible interfaces for reusable UI primitives.