What problem does it solve?
It helps you replace brittle React APIs that rely on many boolean props with maintainable component composition, so your UI remains flexible as features grow.
Core Features & Use Cases
- Avoid Boolean Prop Proliferation: redesign components so state/variants don’t explode into hard-to-reason conditional logic.
- Build Compound Components: use shared context so subcomponents access state/actions without prop drilling.
- Lift State into Providers: move state ownership into provider components so sibling or external UI can share and modify it reliably.
- Prefer Children over Render Props: improve readability and composition ergonomics for reusable component APIs.
- Create Explicit Component Variants: replace ambiguous “mode” props with named variants like ThreadComposer or EditComposer.
- Align with React 19 APIs: apply React 19 guidance such as using
use() for context access patterns and treating ref as a regular prop.
Quick Start
Ask an AI agent to refactor your component by identifying every boolean prop mode and replacing it with explicit variant components that share a lifted context provider for state, actions, and meta.