Reusable bits of code range between two extremes: Highly-opinionated small numbers of large chunks vs. highly-flexible large numbers of small chunks. Finding a balance between the two is hard. Dependency injection can provide the best of both worlds, so can we leverage it in React as well?
When it comes to opinionated and universal code, each approach presents its own pros and cons. There are also other questions that need to be answered, such as: What if we combined these two approaches?
In his video presentation, Salsita Chief Architect Jiri Stanisevsky goes over these trade-offs, explains dependency injection and gives a demo on how to use it in React.
As Chief Architect, Jiri works with TypeScript, React, React Hooks, Node JS, and other technologies. What gives him the most pleasure is creating reusable components, small libraries, and frameworks. Out of the office he enjoys spending time with his two daughters and re-watching classic episodes of The Simpsons.