Erin Zimmer

Erin Zimmer Senior Engineer Atlassian

Dependency Injection with React Context

explore the program

Dependency Injection with React Context

Dependency injection is a common software pattern, with clear benefits, including easier testing, and better reusability of code. While there are React dependency-injection libraries available, React doesn't provide a native implementation of this pattern. It does, however, provide useContext, which can be used to gain many of the benefits of dependency injection. Today, we're going to take a look at why you might want to use dependency injection, how you can go about doing it with useContext, and what the pros and cons are of this approach vs using a library.

Erin Zimmer

Erin is a Google developer expert, with over ten years experience in a variety of languages, from JavaScript to Model204 (no, nobody else has heard of it either). She is currently Senior Engineer at Atlassian. She is an active member of the Melbourne developer community, and has spoken at conferences around the world. If you see her at a conference, she'll probably have knitting needles in hand.

Code of Conduct

For over a decade, we've worked hard to create inclusive, fun, inspring and safe events for the Web Industry.

As part of our commitment to these values, we've adopted a code of conduct for all involved: ourselves, our speakers, our partners and our audience.

If you have any concern or feedback, please don't hesitate to contact us.