Course contentsShow
← React
Lesson 1686 of 2,39641. State Management EcosystemFree lesson

The Prop Drilling Pain Threshold

Passing props through 2-3 levels is fine; only consider Context or global state when drilling becomes unmanageable.

The Prop Drilling Pain Threshold

What you'll learn: You'll discover when passing props through multiple components becomes a problem worth solving — and when it's actually fine.

What Is Prop Drilling?

Prop drilling is passing props through intermediate components that don't use them, just to get data to deeply nested children. It's often treated as an anti-pattern, but the reality is more nuanced.

The 2-3 Level Rule

Passing props through 2-3 levels is perfectly acceptable. This is normal React component composition and doesn't warrant introducing Context or global state management. The code remains readable, type-safe, and easy to refactor.

// This is FINE — only 2 levels deep
function App() {
  const [user, setUser] = useState(null);
  return <Dashboard user={user} />;
}

function Dashboard({ user }) {
  return <Sidebar user={user} />;
}

function Sidebar({ user }) {
  return <UserProfile user={user} />; // Actually uses it
}

When It Becomes a Problem

The pain threshold is crossed when:

  • You're drilling through 4+ levels of components
  • Multiple props are being threaded through the same path
  • The intermediate components have no logical connection to the data
  • Refactoring becomes difficult because props are scattered everywhere

Think of it like passing a message through people in a room. Asking your neighbor to tell someone across the room is fine. Creating a human chain of 8 people whispering the same message? That's when you need a better system (Context, a state management library, or architectural refactoring).

The Right Solution Depends on the State Type

Before reaching for Context or Redux, consider: is this UI state that naturally belongs higher up, or is it server state that should use a data-fetching solution? Often, the "drilling" pain is actually a signal that your state architecture needs rethinking, not just a technical band-aid.

Key Takeaway: Prop drilling through 2-3 levels is normal React — only consider Context or global state when you're threading multiple props through 4+ unrelated components and refactoring becomes painful.