Recall & Review
beginner
What are props in React?
Props are inputs to React components. They are used to pass data from a parent component to a child component.
Click to reveal answer
beginner
Why should props be treated as read-only in React?
Props should not be changed inside the child component because React relies on props being stable to manage component updates predictably.
Click to reveal answer
intermediate
What happens if you try to modify props directly inside a React component?
Modifying props directly can cause bugs and unexpected behavior because React expects props to be immutable and controlled by the parent component.
Click to reveal answer
intermediate
How can a child component update data passed via props?
A child component can call a function passed as a prop from the parent to request changes. The parent then updates its state and passes new props down.
Click to reveal answer
beginner
Explain the difference between props and state in React.
Props are read-only data passed from parent to child. State is data managed inside a component that can change over time.
Click to reveal answer
In React, can a component modify its own props directly?
✗ Incorrect
Props are read-only data passed from parent to child and should never be modified inside the child component.
How does a child component request a change to data passed via props?
✗ Incorrect
The child calls a function passed as a prop to notify the parent to update its state, which then updates the props.
What is the main reason React treats props as immutable?
✗ Incorrect
Immutable props keep data flow predictable and help React manage component updates reliably.
Which of the following is true about props and state?
✗ Incorrect
Props are read-only inputs from parent, while state is internal data that a component can change.
If a parent component changes its state, what happens to the props of its child components?
✗ Incorrect
When the parent state changes, it passes new props to children, causing them to re-render with updated data.
Explain why props in React are considered read-only and how this affects component design.
Think about how data flows in React and why stability matters.
You got /4 concepts.
Describe how a child component can update data it receives via props without modifying props directly.
Focus on the communication between parent and child.
You got /4 concepts.