Complete the code to load the component only when it becomes visible in the viewport.
<MyComponent [1] />The client:visible directive tells Astro to load the component only when it enters the viewport.
Complete the code to import and use a component with viewport-based loading.
--- import MyComponent from './MyComponent.astro'; --- <div> <[1] [2] /> </div>
Use the imported component name MyComponent and the client:visible directive for viewport-based loading.
Fix the error in the component usage to enable viewport-based loading.
<MyComponent [1] />The correct directive for viewport-based loading is client:visible.
Fill both blanks to create a component that loads only when visible and passes a prop.
<[1] [2] someProp="value" />
The component name goes first, then the client:visible directive to enable viewport-based loading.
Fill all three blanks to import a component, use viewport-based loading, and pass a prop.
--- import [1] from './[2].astro'; --- <[3] client:visible message="Hello" />
You import the component by name and filename, then use it with client:visible and pass props.