Props Passing
Predict Output Beginner
Question
What does this code print?
Code
function Greeting({name}) {
return <h1>Hi, {name}!</h1>;
}
// <Greeting name="Ada" />
// What renders?
Hint
Props are passed as attributes and received as function arguments.
Explanation
The name prop "Ada" is passed to Greeting, which destructures it and renders "Hi, Ada!". Props flow from parent to child.
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.