Created
July 27, 2021 17:52
-
-
Save MauricioRobayo/d40237f842661383c6411612391f2f94 to your computer and use it in GitHub Desktop.
Render props https://reactjs.org/docs/render-props.html #gogofast
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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