Rojo starts with a user form that grows from account creation to updates and name-only edits. Each variation adds more flags, conditions, and optional behavior, making the component harder to understand and change.
Composition Is All You Need
Speaker
Fernando Rojo discusses composing flexible React interfaces and state management at React Universe Conf 2025, hosted by Callstack.
Rojo uses Slack’s composer to show how one interface serves channels, threads, message editing, and forwarding. These versions differ in actions, attachments, submission behavior, and whether draft state syncs across devices or stays temporary. Adding a boolean for each variation spreads conditions through the component.
Rojo replaces the monolithic composer with a provider and smaller parts such as a frame, header, input, footer, and optional drop zone. Each use case renders the pieces it needs with JSX, while shared pieces like CommonActions can be reused. Editing, for example, simply omits the drop zone and renders its own footer buttons.
The provider gives child components a common interface for state and actions, while its implementation can vary. A forwarding composer can use local state, while a channel composer can use a hook that syncs state across devices. Lifting the provider above the composer also lets external buttons use its actions without passing state through callbacks.
Rojo argues that clear component structure remains valuable when AI writes code. He describes using composition-focused prompts while building Vercel’s mobile app and his Chess Zero side project, and says the resulting code was easier for him to edit and produced fewer bugs.
Takeaways
- When variations keep adding boolean props, split the interface into components that each use case can compose.
- Use JSX to arrange one-off UI and shared components for repeated groups of actions.
- Keep a shared state interface in a provider, and let each use case supply its own state implementation.
- Lift a provider high enough for related controls outside the main component to access its state and actions.
- A codebase with clear composition can make AI-generated React code easier to review and edit.
Mentioned in this talk
Search inside this talk
What was claimed 4
- featurecomposition: Supports flexible React UIs by composing reusable components and shared state providers rather than accumulating conditional props.
“we split it up, starting with the composer provider”
YouTube Unverified1 source· Talk
- featureReact Compiler: Can memoize a component based on the context inputs it accesses.
“it actually memoizes this input based only on the inputs we access from the context”
YouTube Unverified1 source· Talk
- usesChess Zero uses
Vercel
“a chess app I built with Vercel”
YouTube Unverified1 source· Talk
- builtFernando Rojo built Chess Zero
“My side project is Chess Zero, a chess app I built with Vercel using only my voice”
YouTube Unverified1 source· Talk










