In my opinion, none of your examples has anything to do with actual dependency injection.
David Losert
91

Thanks for your comments!

Responding to:

In my opinion, none of your examples has anything to do with actual dependency injection.

I completely agree—my point is that there is no need for dependency injection in React components. I went through the use cases for dependency inversion in the Angular docs and showed how one can solve the same problems (well) in React, without DI.

I like your additional example of why/when DI is useful:

… you are able to configure what your component will do on a high level — outside of your actual application code … For example: If you wanted to code against a Mock API instead of the real one during Development …

However, the solution I’ve seen most often for environment-specific configuration is to use environment variables, which works really well.