What problem does it solve?
This Skill helps teams refactor React components by replacing boolean prop proliferation with explicit composition patterns, enabling more maintainable, reusable APIs. It focuses on compound components, render props, and context providers, and it accounts for React 19 API changes.
Core Features & Use Cases
- Explicit variants: replace multi-flag components with dedicated ThreadComposer, EditMessageComposer, and ForwardMessageComposer variants.
- State that travels with providers: lift state into providers so UI components stay decoupled from state management.
- Composable internals via context: subcomponents access shared state through a common context rather than prop drilling.
- Suitable for building scalable component libraries, refactoring large UIs, and designing flexible APIs that teams can extend.
Quick Start
Inspect existing code to identify where boolean props are used and plan explicit variant components (ThreadComposer, EditMessageComposer, ForwardMessageComposer).
Implement a Provider-based UI using a shared Composer context and a Frame/Input/Submit subcomponent set to assemble the UI.
Swap providers to reuse the same UI across different use cases without prop drilling; then render the appropriate variant in your app.