0
0
Astroframework~20 mins

When to hydrate vs keep static in Astro - Practice Questions

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Astro Hydration Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
component_behavior
intermediate
2:00remaining
What happens when you use client:load in Astro?
In Astro, if you add client:load to a component, what is the expected behavior of that component on the client side?
Astro
<MyComponent client:load />
AThe component is rendered statically on the server and then hydrated immediately after the page loads on the client.
BThe component is never hydrated and remains static HTML only.
CThe component is hydrated only when it enters the viewport (lazy hydration).
DThe component is hydrated only when the user clicks on it.
Attempts:
2 left
💡 Hint
Think about when hydration happens with client:load compared to other hydration directives.
component_behavior
intermediate
2:00remaining
Choosing hydration strategy for a static info card
You have a simple info card component in Astro that only displays static text and images. Which hydration directive should you use to optimize performance?
Astro
<InfoCard client:??? />
ANo hydration directive to keep it static
Bclient:idle to hydrate when the browser is idle
Cclient:visible to hydrate only when the component scrolls into view
Dclient:load to hydrate immediately after page load
Attempts:
2 left
💡 Hint
If the component does not need interactivity, what is the best choice?
state_output
advanced
2:00remaining
What is the hydration behavior of client:visible in Astro?
Consider this Astro component usage:
<InteractiveWidget client:visible />
What happens when the page loads and the widget is initially off-screen?
Astro
<InteractiveWidget client:visible />
AThe component is hydrated immediately after page load regardless of visibility.
BThe component is hydrated only when it scrolls into the viewport.
CThe component hydrates only after a user clicks anywhere on the page.
DThe component never hydrates and stays static.
Attempts:
2 left
💡 Hint
Think about lazy hydration triggered by visibility.
🔧 Debug
advanced
2:00remaining
Why does this Astro component stay static despite client:load?
You wrote:
<MyButton client:load />
But the button does not become interactive after page load. What is the most likely cause?
Astro
<MyButton client:load />
AThe <code>client:load</code> directive only works for server components, not client components.
BAstro does not support hydration directives on components inside layouts.
CThe component's JavaScript is missing or not bundled correctly, so hydration fails.
DThe component is hydrated but the browser cache prevents updates.
Attempts:
2 left
💡 Hint
Check if the component's JavaScript is properly included in the build.
🧠 Conceptual
expert
2:00remaining
When should you prefer static rendering over hydration in Astro?
Which scenario best justifies keeping a component static without hydration in Astro?
AA form that validates user input before submission.
BA live chat widget that updates messages in real-time.
CA navigation menu that requires dropdown interactivity on hover and click.
DA footer with only copyright text and links that never change.
Attempts:
2 left
💡 Hint
Think about when interactivity is not needed at all.