What problem does it solve?
This Skill addresses the complexity of building and maintaining React components, particularly those that grow unwieldy with numerous conditional props or complex state management.
Core Features & Use Cases
- Component Architecture: Guides on avoiding boolean prop proliferation and using compound components for better structure.
- State Management: Strategies for decoupling state from UI, defining generic context interfaces, and lifting state into providers.
- Implementation Patterns: Best practices for creating explicit component variants and preferring children over render props.
- React 19 APIs: Covers new API changes like
use() and direct ref handling.
- Use Case: Refactoring a large
UserProfile component that currently uses many boolean flags (e.g., isEditing, showAvatar, isPrivate) into a more composable structure using compound components and explicit variants.
Quick Start
Apply the vercel-composition-patterns skill to refactor the Composer component in src/components/Composer.tsx to use compound components and avoid boolean prop proliferation.