Skip to main content
React Output Prediction Easy +10 XP

Props Access

What does this component render?

ReactRead-only
function Greeting({ name }) {
  return <h1>Hello, {name}!</h1>;
}
<Greeting name="Alice" />

What is the output?

Show answer and explanation

Answer: Hello, Alice!

Props are passed as attributes. The component destructures name from props and renders it inside JSX {}.

Hint: name prop is passed as 'Alice'.

What this challenge tests

Output Prediction in React: props, jsx.

Related challenges