Props Immutability
Question
Can a component modify its own props?
Hint
Props must never be mutated; use state for changes.
Explanation
React props are read-only by design. A component must never modify its own props. This enforces unidirectional data flow — data flows down from parent to child. If a component needs to change data, it should use local state (useState) or call a callback prop to ask the parent to change the data. Mutating props directly causes bugs and breaks React reconciliation.
Related Resources
Related Lessons
- Props
Learn props.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.