November 1, 2018 07:25 pm GMT
Original Link: https://blog.bitsrc.io/understanding-react-render-props-and-hoc-b37a9576e196
Understanding React Render Props and HOC
Heres 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 lets say you have a component called Username
that just returns a string of a users 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.
Original Link: https://blog.bitsrc.io/understanding-react-render-props-and-hoc-b37a9576e196
Share this article:
Tweet
View Full Article