Sobes.tech
Middle+

What is prop drilling and what problems does it create?

sobes.tech AI

Answer from AI

Prop drilling is a situation in React and other UI components where data (props) are passed through several levels of nested components to reach the desired child component. This results in intermediate components receiving and passing props even if they do not use them.

Problems of prop drilling:

  • Increased complexity of code and its maintenance.
  • Excessive code in intermediate components.
  • Difficulties in scaling the application.
  • Difficult component reuse.

To solve this, context (React Context API), state management libraries (Redux, MobX), or hooks are often used to avoid passing props through many levels.