Complete the code to pass a prop named title with value "Hello" to the Header component.
function App() {
return <Header [1] />;
}The prop name must match the expected prop in the component. Here, title is the correct prop name.
Complete the code to access the message prop inside the Greeting component.
function Greeting(props) {
return <p>{props.[1]</p>;
}props. prefix.Props are accessed via props.propName. Here, the prop is named message.
Fix the error in the code by completing the destructuring of props in the Info component.
function Info([1]) { return <div>{name} is {age} years old.</div>; }
Destructuring props requires curly braces around the prop names inside the function parameter.
Fill both blanks to pass color and size props to the Button component.
function App() {
return <Button [1] [2] />;
}Props are passed as attributes with their names and values. Here, color and size are the correct prop names.
Fill all three blanks to create a UserCard component that receives name and email props and displays them.
function UserCard([1], [2]) { return ( <div> <h2>[3]</h2> <p>{email}</p> </div> ); }
The component destructures name and email props. Then it displays name inside the h2 tag.