Part 1
Chapter 1: Beyond the Component...--–- You’ve written React components before. Maybe dozens. Maybe hundreds. You know how useState works, you’ve passed props down a few levels, and you’ve even used useEffect to fetch data from an API. By every reasonable measure, you can build applications that work. But somewhere along the way, you’ve started to notice something uncomfortable. Your components are becoming harder to test. Adding a new feature breaks an old one in ways you didn’t expect. The codebase that felt like a house of cards collapses under its own weight every time a product manager asks for “just one small change.” You’re not alone.This feeling has a name: the junior-to-senior chasm.
It’s the gap between writing code that runs and writing systems that survive. And the single most important shift you will make as an engineer is not learning another hook or another library. It’s moving from a component-centric view of the world to a system-architecture view. That transformation begins in this chapter.The Hidden Cost of Component ThinkingWhen you learn React, the tutorials teach you components. A button component. A card component. A form component. Everything is a component, and the examples are always small, self-contained, and beautiful. But production applications are not beautiful. They are messy, interconnected, and full of edge cases that no tutorial ever warned you about.
The problem with component-centric thinking is that it optimizes for the individual tree while ignoring the forest.Consider this: you have a UserProfile component that fetches user data, a UserAvatar component that displays that data, and a UserMenu component that depends on the same information. The component-centric approach says each piece should manage its own state. So you end up with three separate data fetches, three loading states, and three potential points of failure for the same piece of information. This is not a React problem. It is an architectural problem that React makes visible.The React engineer thinks differently. Instead of asking “what component needs this data?”, they ask “what is the shape of my state, and how does it flow through my system?”