Skip to content
Discussion options

You must be logged in to vote

Prop drilling in React is when you pass data from a parent component down to deeply nested child components through every level in between even if those middle components don’t need that data themselves, they're just passing it along.

As a dev, it's like this: you’ve got a piece of state or a function in a top-level component, but you need it five levels down. Instead of accessing it directly down there, you end up writing prop={something} at every level just to get it to the bottom. It clutters your components and makes things harder to maintain, especially in bigger apps.

A common fix is using context, which lets you skip those middle layers and access the data directly where it’s needed.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by SAMRANGO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants