Render Props is a simple technique for sharing code between components using a prop whose value is a function. The below component uses render prop which returns a React element.
In this question, we have shared what are render props in reactjs with an example.
1 2 3 | <DataProvider render={data => ( <h1>{`Hello ${data.target}`}</h1> )}/> |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.