Course contentsShow
← React
Lesson 822 of 2,39621. Context FundamentalsFree lesson

The Coupling Issue: Components That Don't Care

Why intermediate components become unnecessarily coupled to data they don't use, reducing reusability.

The Coupling Issue: Components That Don't Care

You'll learn why passing props through intermediate components creates unnecessary dependencies that hurt code reusability.

What the Problem Looks Like

When you prop drill, every component in the chain must know about the data—even if it doesn't actually use it. A component that only passes props down becomes coupled to those props, meaning it can't be reused in contexts where that data doesn't exist.

Imagine a layout component that arranges its children. It shouldn't care whether those children need user data, theme colors, or shopping cart items—it's just about layout. But with prop drilling, you're forced to thread those props through it anyway:

function PageLayout({ user, theme, cartItems, children }) {
  // This component doesn't USE any of these props!
  // It just forwards them to children
  return (
    <div className="layout">
      <Header user={user} theme={theme} />
      <Main cartItems={cartItems}>{children}</Main>
    </div>
  );
}

Now PageLayout is coupled to user, theme, and cartItems. You can't reuse it in a public landing page (no user), a simple blog (no cart), or a different app without those exact prop names.

The Reusability Tax

Every prop you add to an intermediate component makes it less generic and harder to move between projects or contexts. The component becomes a middleman that knows too much about business logic it doesn't care about.

Key Takeaway: Prop drilling couples intermediate components to data they don't use, reducing their reusability and making them harder to understand and maintain. Context breaks this coupling by letting deeply nested components access data directly.