A prop is a read-only value passed from a parent component to a child. The parent remains the source of truth, while the child receives data and may request changes through an updater function. section 4.2
In an interview, emphasize that props:
- Move data downward, making state changes more predictable and debugging easier. section 4.2
- Should not be modified directly by children; children call parent-provided updater functions instead. section 4.2
- Can become prop drilling when intermediate components pass values they do not use. section 4.2
Passing a prop through components
const Parent = () => <ChildA data="Hello from Parent!" />; const ChildA = ({ data }) => <ChildB data={data} />; const ChildB = ({ data }) => <ChildC data={data} />; const ChildC = ({ data }) => <p>{data}</p>; This works, but deeply nested trees may benefit from Context API or another state-sharing pattern. 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.
|
Compare one-way binding, lifting state, Context API, and state-container patterns across foundational, applied, and advanced usage. section 4.2





