What problem does it solve?
This guide eliminates boolean prop proliferation and fragile conditional logic that make React components hard to reason about, test, and maintain, especially as codebases grow or when AI agents assist with refactors.
Core Features & Use Cases
- Compound Components & Providers: Design components as composable parts that share state via a provider rather than prop drilling.
- State Lifting & Dependency Injection: Move state into provider boundaries and define generic context interfaces (state, actions, meta) so the same UI works with different state implementations.
- Explicit Variants & Composition Patterns: Replace boolean modes with explicit variant components and prefer children composition over render props for clarity.
- React 19 Guidance: Adjust patterns for React 19 APIs, e.g., prefer use() over useContext() and treat ref as a normal prop when applicable.
- Use Cases: Refactoring legacy components with many booleans, building reusable component libraries, reviewing component architecture, and implementing consistent patterns across a UI system.
Quick Start
Refactor a Composer component to remove boolean props by introducing a Provider with a state/actions/meta context and split the UI into compound subcomponents that consumers compose.