Prop drilling forwards data through intermediate React components that do not use it so a deeply nested child can consume it. It preserves one-way data flow but can make component interfaces bloated and harder to maintain. section 4.2
An interview-ready explanation should distinguish the pattern from its alternatives:
- Parent-owned state remains the source of truth; children receive read-only data and updater functions through props. section 4.2
- React Context API removes repeated forwarding by providing shared data to descendants, while introducing maintainability and re-render trade-offs. section 4.2
A three-level forwarding chain
ParentComponent passes data to ChildA, which forwards it to ChildB, which forwards it to ChildC. Only ChildC renders the value, so ChildA and ChildB carry an unused prop. section 4.2
Table 4.5 Data flow in React
|
Topic
|
Fundamentals
|
Applied skills
|
Advanced
|
|
One-way data binding
|
Explain unidirectional flow.
|
Manage props, lifting state up.
|
Architect Context API or state container patterns for global state.
|
|
State management options
|
Use
useState,
useReducer.
|
Apply Context API effectively.
|
Architect advanced state management solutions with Redux (
https://redux.js.org), MobX (
https://mobx.js.org), Zustand (
https://zustand.docs.pmnd.rs), Jotai (
https://jotai.org), or Recoil (
https://recoiljs.org).
|
|
Context API
|
Share state globally without props.
|
Combine with useReducer for complex global state.
|
Optimize context re-renders, split contexts for performance.
|
Use the comparison to position prop drilling alongside one-way binding, Context API, and broader state-management options. section 4.2
