InterviewHubPRO
Section Overview
Q66

Question 66 of 445

Part 1: Core React, JSX & Component Architecture (1 - 77)

15%
React & Modern Frontend (445 Qs)•Part 1: Core React, JSX & Component Architecture (1 - 77)

Why can't you update props in React?

The React philosophy is that props should be immutable(read only) and top-down. This means that a parent can send any prop values to a child, but the child can't modify received props.

Practical Code Example

jsx
// Props are strictly READ-ONLY to ensure predictable unidirectional data flow:
function Profile(props) {
  // props.name = 'Bob'; // TypeError: Cannot assign to read only property

  // Correct: Notify parent component via callback to update its state!
  return <h1>{props.name}</h1>;
}