Render props means passing the JSX you want rendered to a component as a function prop: the component owns the logic and the state, while the caller receives the data as an argument and decides what to render. It decouples logic reuse from UI customization, and it was the most common reuse pattern before hooks arrived. Because the data arrives as a plain argument, one implementation can serve many very different interfaces without knowing anything about any of them.
Group
Component Patterns
Kind
Pattern
ℹ️ Info The editor transpiles JSX to JavaScript and renders the real UI in a sandbox; components mount automatically — no manual render call needed.
📝 Syntax
function DataProvider({ render }) {
const data = /* the data produced by the logic */
return render(data) // call the render function and hand the data back
}
// usage: <DataProvider render={data => <List items={data} />} />
Returns:No return value; this entry describes an encoding pattern rather than a function.
▶ Example
The example runs out of the box: it auto-renders when expanded, and edits take effect instantly.
Output:
The same Counter logic is rendered into two completely different interfaces, and the two counters accumulate independently without interfering with each other.
Q Are render props and function children the same thing?
A The mechanism is identical: you pass a function as a prop and the component calls it with the data. A function child is just a more compact spelling.
Q Do we still need render props now that hooks exist?
A Hooks are better for most logic reuse, but render props still fit when one piece of logic must render very different interfaces and you want to take over the view completely.
Q Is the render function rebuilt on every render?
A Yes, it is an inline arrow function. A render props component only calls it without a memo shallow comparison, so it usually does not become a performance problem.
Web-Tutorial Tech Team
A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.