vercel-labs / agent-skills
vercel-composition-patterns
React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.
Install
npx skills add https://github.com/vercel-labs/agent-skills --skill vercel-composition-patterns- title
- Prefer Composing Children Over Render Props
- impact
- MEDIUM
- impactDescription
- cleaner composition, better readability
- tags
- composition, children, render-props
Prefer Children Over Render Props
Use children for composition instead of renderX props. Children are more
readable, compose naturally, and don't require understanding callback
signatures.
Incorrect (render props):
Correct (compound components with children):
When render props are appropriate:
Use render props when the parent needs to provide data or state to the child. Use children when composing static structure.