Summary
In this chapter, we first learned about React Context as an alternative to passing down props over multiple levels of React components. We then learned about context providers and consumers, and the new way to define consumers via Hooks. We used what we learned in practice, by implementing theme support in our blog app. Next, we learned when it does not make sense to use contexts, and when we should use inversion of control instead. Finally, we used a context for the global username
state in our blog app.
In the next chapter, we are going to learn how to request data from a server, using React and Hooks. Then, we are going to learn about React Suspense, so that we do not have to wait for the requests to finish before rendering our app.