React | Functional components | Question 6

Last Updated :
Discuss
Comments

What will be the output of the following code?

JavaScript
const Greeting = (props) => {
    return <h1>Hello, {props.name}!</h1>;
};
<Greeting name="Sandeep" />

Hello, Sandeep!

Hello, undefined!

Greeting: Sandeep

Error: props is not defined

Share your thoughts in the comments