‘If you don’t need to add logic to a component why would you wrap it in a HOC in the first place? Just pass it as a child to another component and render it with “props.children”.’
The whole point of an HOC is to add something to a component. However, if you need to customize the props or logic you’re adding to make it work properly with a specific component you’re trying to enhance, hooks may be a better fit because hooks allow you to specify how or even if props are passed to or used by the component you’re enhancing. HOCs would require you to write a container component to cutomize props and behavior for the enhanced child compoment.
As discussed in the article, render props must always control if or how props are communicated to the enhanced components. That’s the whole point of them.
Render props also invert control, making them a little confusing and syntax-heavy. Now that we have hooks, render props are entirely redundant with hooks. I recommend using hooks instead wherever render props may have been useful before.
But because neither can compose automatically using standard function composition, neither can replace HOCs.
I wrote an entire book emphasizing how fundamental function composition is to software development. Learning the power of automatic, declarative composition will have a dramatic complexity-reducing impact on the code you write.