When Drilling Isn't a Problem
You'll learn: Not all prop drilling is bad—shallow drilling (2-3 levels) is often clearer and simpler than introducing complex abstractions.
The Core Idea
After learning about prop drilling, you might feel like it's something to avoid at all costs. But that's not true! Passing props through 2-3 component levels is completely normal and often the best solution. It's only when drilling becomes deep (5+ levels) or involves many props that it becomes a problem worth solving.
Think of it like passing a message through people standing in a line. Passing a note through 2-3 people? Easy and clear. Passing it through 15 people? Now you've got a communication problem worth solving with a phone call or email.
Why Shallow Drilling is Fine
When props pass through just a few components:
- Traceability: You can easily follow where data comes from and goes
- Simplicity: No need to learn or set up additional patterns
- Readability: Other developers can understand the flow at a glance
- Maintenance: Refactoring is straightforward—just follow the chain
Introducing solutions like Context API or state management libraries for shallow drilling adds complexity that outweighs the "problem" you're solving. You're trading a simple, explicit data flow for additional abstractions that teammates need to understand.
When to Just Drill
If you can see the entire component chain on one screen, drilling is probably fine. If the props only pass through 2-3 "middleman" components that don't care about them, that's still manageable. Only when you find yourself constantly scrolling through files or passing the same 5+ props through deep hierarchies should you consider alternatives.
Key Takeaway: Prop drilling through 2-3 levels is normal, readable, and often better than premature abstraction—don't optimize away simple, traceable code.