In React, managing shared data between components can be challenging as the application grows. Passing props through multiple levels (a process known as prop drilling) can quickly make our code verbose and difficult to maintain.

Prop drilling

Prop drilling is a situation in React where data (props) is passed from a parent component to deeply nested child components through intermediate components that don’t need the data. It occurs when a parent component needs to provide data or functions to a child that is several layers deep in the component tree, requiring each intermediate component to drill or forward the props down the hierarchy.

Get hands-on with 1400+ tech skills courses.