What problem does it solve?
It solves maintainability issues that arise when React components grow too configurable through boolean props, tangled state, or brittle component boundaries.
Core Features & Use Cases
- Avoid boolean prop proliferation: prevents combinatorial UI states by replacing mode switches with compositional structure.
- Use compound components with shared context: builds reusable component “parts” that cooperate through injected state, actions, and meta.
- Lift and decouple state management: centralizes state logic in provider components so UI stays implementation-agnostic.
- Prefer children over render props: improves readability and natural composition for static layout concerns.
- Create explicit component variants: makes intent self-documenting by using separate variants (e.g., ThreadComposer vs. Composer with flags).
- Align with React 19 API conventions: recommends using
use() instead of useContext() and treating ref as a regular prop.
Quick Start
Tell the AI to audit your component API for boolean prop modes, then refactor it into explicit variants using compound components and lifted state via context providers.