back home

Dependency Inversion

D in [SOLID] - his principle tells us that we should depend upon abstractions, not concretions. In React, this is sort of native already. We use props and thus dictate the behaviour of the child from the outside. It relies on whatever is passed down in order to do it’s thing. [Render props] and [Higher Order Components] are a great example of this. We inject dependencies externally and they change how the component behaves.