0
0
Astroframework~5 mins

When to hydrate vs keep static in Astro - Quick Revision & Key Differences

Choose your learning style9 modes available
Recall & Review
beginner
What does it mean to hydrate a component in Astro?
Hydrating a component means adding JavaScript to make it interactive after the page loads. It turns static HTML into a live, interactive part of the page.
Click to reveal answer
beginner
When should you keep a component static in Astro?
Keep a component static when it only shows content that doesn't change or need user interaction. This makes the page faster and simpler.
Click to reveal answer
beginner
What is a real-life example of when to hydrate a component?
If you have a button that changes color when clicked, you hydrate it so the button can respond to clicks and update on the page.
Click to reveal answer
intermediate
How does keeping components static improve website performance?
Static components load faster because they don’t need extra JavaScript. This means less data to download and quicker page display.
Click to reveal answer
intermediate
What are the downsides of hydrating too many components?
Hydrating many components adds more JavaScript, which can slow down the page and use more device power, making the site less efficient.
Click to reveal answer
What does hydration do in Astro?
AMakes static HTML interactive by adding JavaScript
BRemoves JavaScript from the page
CConverts JavaScript to HTML
DPrevents user interaction
When should you keep a component static?
AWhen it needs to respond to clicks
BWhen it fetches data dynamically
CWhen it animates on scroll
DWhen it only displays fixed content
What is a downside of hydrating many components?
AFaster page load
BSlower page and more power use
CLess JavaScript on the page
DNo user interaction
Which component should you hydrate?
AA header with fixed title
BA static text paragraph
CA button that changes color when clicked
DAn image with no interaction
How does keeping components static help users?
ABy loading pages faster
BBy reducing interactivity
CBy adding more JavaScript
DBy making pages slower
Explain when you should hydrate a component versus keep it static in Astro.
Think about whether the component needs to respond to user actions.
You got /4 concepts.
    Describe the impact of hydrating too many components on website performance.
    Consider what happens when the browser has to do more work.
    You got /4 concepts.