Introduction
In the previous chapter, we saw the detailed approach of using Hooks inside a component. We extracted the component into a separate and unique hook so that we can reuse it elsewhere across multiple components. Then, we went on and externalized the logic and created our own custom hook that lived outside the component.
We have seen how every hook has its own utility and we have figured out how to apply them to suit our needs; and all of this without using class-based components, which can easily grow out of control if we want to modify or reuse them. When we build programs and applications, however, we realize that they are not isolated systems. We need to think about their global state management, dependencies, theming, and so on; for example, when you set up a theme in your project and you most likely want to use it throughout your entire app. That theme object gives consistency in every component. Alternatively, if you have an app that requires authentication, you...