Skip to content

Instantly share code, notes, and snippets.

@MauricioRobayo
Created July 27, 2021 17:52
Show Gist options
  • Save MauricioRobayo/d40237f842661383c6411612391f2f94 to your computer and use it in GitHub Desktop.
Save MauricioRobayo/d40237f842661383c6411612391f2f94 to your computer and use it in GitHub Desktop.
The term “render prop” refers to a technique for sharing code between React components using a prop whose value is a function.
A component with a render prop takes a function that returns a React element and calls it instead of implementing its own render logic.
<DataProvider render={data => (
<h1>Hello {data.target}</h1>
)}/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment