Render props
Source: https://dev.to/softchris/the-amazing-render-props-pattern-for-reactjslifecycle-begone-34k1
Render props
Why would we want that?
Use cases
Example:
const ProductDetail = ({ product }) => (
<React.Fragment>
<h2>{product.title}</h2>
<div>{product.description}</div>
</React.Fragment> )
<Fetch url="some url where my data is"
render={(data) => <ProductDetail product={data.product} /> }
/>Last updated