Q19: What is Prop Drilling and how can it be avoided?
Prop Drilling occurs when props are passed through multiple intermediate components that do not need them, simply to reach a deeply nested child. It can be avoided using React Context, component composition, or state management tools.
Key Takeaways
- Prop drilling creates unnecessary component coupling down deep hierarchies.
- Avoid via React Context, Redux/Zustand, or component composition techniques.
Knowledge Check
Which design pattern helps avoid prop drilling without using external state libraries?