Find: Modifying Props
Find the Mistake Easy
Question
What is wrong with this component?
Code
function Welcome({ name }) {
name = name.toUpperCase();
return <h1>Hello, {name}!</h1>;
}
Hint
Props should be treated as read-only.
Explanation
The component modifies the name prop directly. Props are read-only and should never be mutated. The fix is to create a local variable: const upperName = name.toUpperCase(); or inline it: {name.toUpperCase()}.
Related Resources
Related Lessons
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.