10 Advanced React Hooks for scaling
This chapter covers
- Structuring data flow with React Context
- Managing complex state with reducers
- Creating custom hooks for code reuse
What we have learned so far, is all you need to know to build small, simple React applications by yourself. You have all the knowledge and tools required to create stateful, interactive, and relevant React widgets with a few interconnected components. But only as long as you're working on fairly small projects.
In the real world, your React applications will most likely be a lot bigger and more complex than any of the examples we have examined thus far. You could create small widgets (e.g. a BMI calculator) for a website that have just a couple of components and still do a good job, but those are rare and far between and mostly relevant to the hobby developer.
What is more likely is that you as a professional React engineer will either be developing a larger application on your own, or an even larger application as part of a team. As applications grow larger, component interfaces grow more complex and working on the codebase requires more finesse.
A couple of things might start to become a problem, if you develop your applications without structure or procedure: