0
0
Astroframework~20 mins

Choosing the right framework for each island in Astro - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Astro Islands Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
component_behavior
intermediate
2:00remaining
How does Astro hydrate components on islands?

Consider an Astro page with multiple islands using different frameworks. What happens when you specify client:load on a React island?

Astro
<AstroIsland client:load>
  <ReactComponent />
</AstroIsland>
AThe React component is rendered only on the server and never hydrated on the client.
BThe React component loads and hydrates immediately after the page loads, enabling interactivity.
CThe React component waits for a user click before hydrating.
DThe React component hydrates only when it scrolls into view.
Attempts:
2 left
💡 Hint

Think about what client:load means for hydration timing.

📝 Syntax
intermediate
2:00remaining
Correct syntax to import and use a Vue island in Astro

Which option shows the correct way to import and use a Vue component as an island in an Astro page?

A
import MyVue from '../components/MyVue.vue';

&lt;MyVue client:load /&gt;
B
import MyVue from '../components/MyVue.vue';

&lt;MyVue client:idle /&gt;
C
import MyVue from '../components/MyVue.vue';

&lt;MyVue client:visible /&gt;
D
import MyVue from '../components/MyVue.vue';

&lt;MyVue client:media='(min-width: 600px)' /&gt;
Attempts:
2 left
💡 Hint

Remember the common hydration directives in Astro.

state_output
advanced
2:00remaining
State sharing between islands in Astro

You have two islands on the same Astro page: a React island and a Svelte island. You want to share a counter state between them. What is the expected behavior if you update the counter in the React island?

AThe Svelte island automatically updates to reflect the new counter value without extra setup.
BThe React island updates, but the Svelte island shows an error about missing props.
CThe Svelte island does not update because islands are isolated; state is not shared by default.
DBoth islands crash because shared state is not supported in Astro islands.
Attempts:
2 left
💡 Hint

Think about how islands are designed to work independently.

🔧 Debug
advanced
2:00remaining
Why does this Astro island fail to hydrate?

Given this Astro island code, why does the component fail to hydrate on the client?

import Counter from '../components/Counter.jsx';


AThe component file extension is .jsx but Astro requires .tsx for hydration.
BThe hydration directive <code>client:load</code> is missing the colon and should be <code>client-load</code>.
CThe component is not wrapped in an island tag or fragment, so hydration fails.
DThe component is imported but not used inside a valid Astro component or island wrapper.
Attempts:
2 left
💡 Hint

Check how the component is used in the Astro file.

🧠 Conceptual
expert
3:00remaining
Choosing the best framework for each island in Astro

You want to build an Astro page with multiple islands. One island needs fast initial load and minimal JavaScript. Another island requires complex state management and many user interactions. Which frameworks should you choose for each island to optimize performance and developer experience?

AUse Solid.js for the fast-loading island and React for the complex interactive island.
BUse React for the fast-loading island and Vue for the complex interactive island.
CUse Svelte for the complex interactive island and Solid.js for the fast-loading island.
DUse Vue for the fast-loading island and Svelte for the complex interactive island.
Attempts:
2 left
💡 Hint

Consider which frameworks are known for minimal runtime and which excel at complex state.