DEV Community

Discussion on: ⚛️ React: Hooks vs. Render Props vs. Higher-Order Components 👨‍🔬

Collapse
 
bettercodingacademy profile image
Better Coding Academy

It does not clearly identify the source of your data - you have no idea where x and y come from :)

Collapse
 
sonicoder profile image
Gábor Soós

They don't need to know, just like with Dependency Injection in Angular.

Thread Thread
 
bettercodingacademy profile image
Better Coding Academy

Drawing a similarity between Angular and React here isn't particularly beneficial.

In React, tracking down where a particular prop comes from within a nest of multiple HOCs is a huge pain and a massive code smell that Hooks has since addressed beautifully.

Thread Thread
 
sonicoder profile image
Gábor Soós

Aren't we talking about the dependencies of a component?

I don't know why it is necessary to know the source of a dependency inside a component.