Understanding React Render Props and HOC

Here’s a great post by Aditya Agarwal on the difference between render props and higher-order components in React. I particularly like the demo he chose to explain the two. But, to summarize:
Higher-order components (HOCs) take a component and return a component. So let’s say you have a component called Username that just returns a string of a user’s name and you want to capitalize that somewhere – this is the perfect opportunity to use a HOC that wraps …
The post Understanding React Render Props and HOC appeared first on CSS-Tricks.

Link: https://blog.bitsrc.io/understanding-react-render-props-and-hoc-b37a9576e196