Complete the code to pass a prop named 'title' to the component.
<MyComponent [1]="Welcome!" />
The prop name must match the expected property in the component, which is 'title' here.
Complete the code to receive the 'title' prop inside the component.
---
const { [1] } = Astro.props;
---
<h1>{title}</h1>Astro.props contains the props passed to the component. We destructure 'title' to use it.
Fix the error in passing a component as a prop named 'Child'.
--- import ChildComponent from './ChildComponent.astro'; --- <ParentComponent [1]={ChildComponent} />
The prop name is case-sensitive and must match what ParentComponent expects, which is 'Child'.
Fill both blanks to render the passed child component inside the parent.
---
const { [1] } = Astro.props;
---
<div>
<[2] />
</div>We destructure 'Child' from props and then render it as a component with <Child />.
Fill all three blanks to pass a 'message' prop and render it inside the child component.
--- import Child from './Child.astro'; --- <Child [1]=[2] /> --- const { message } = Astro.props; --- <p>{ [3] }</p>
The parent passes the 'message' prop with a string value. The child receives it as 'message' and renders it inside a paragraph.
