13. Composing Hooks to Solve Complex Problems


This chapter will enable you to compose and use hooks with the Context API. You will be able to create hooks for app state management using Context API for UI-related components and to create well-encapsulated and scalable abstractions to handle and manage the app state. By the end of this chapter, you will have a solid understanding of how to use component libraries and logical units in hooks to solve complex problems.


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 ...

Get The React Workshop now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.