Render Props Pattern
Pass a function as a prop that returns JSX to share behavior without coupling UI.
Welcome
In this lesson you will understand the render props pattern — passing a function as a prop that returns JSX — and learn when it is useful for sharing behaviour across components.
What Is Render Props?
Render props is a pattern where a component accepts a prop that is a function. The component calls this function to produce its rendered output. The consumer controls the UI; the component provides the behaviour.
<DataProvider render={data => <UserCard user={data} />} />