Astro with React Islands
What you'll learn: How Astro lets you ship zero JavaScript by default, then "hydrate" only the interactive React components you actually need.
The Problem with Full React Apps
When you build a typical React site (even with Vite or Next.js), every page ships JavaScript for the entire framework and all your components — even for static content like blog posts, marketing pages, or documentation that doesn't need interactivity.
Astro flips this model: it's content-first. By default, it renders everything to static HTML with zero JavaScript. Your blog posts, headers, and footers are just plain HTML that loads instantly.
The Island Architecture
Think of your page as an ocean of static HTML. The interactive parts — a search box, a "like" button, an image carousel — are islands of interactivity floating in that ocean.
With Astro, you write your layout and content in .astro files (HTML-like syntax). When you need React, you import a component and add client:* directives:
---
import BlogPost from '../components/BlogPost.astro';
import LikeButton from '../components/LikeButton.jsx';
---
<BlogPost title="My Article">
<p>Static content here...</p>
<LikeButton client:visible />
</BlogPost>
The client:visible tells Astro: "Only send React and this component's JavaScript when it scrolls into view." The rest? Pure HTML.
Why This Matters
You get the performance of static sites (instant loads, perfect SEO) with React's power exactly where needed. Your content-heavy pages ship kilobytes instead of megabytes.
Key Takeaway: Astro with React Islands uses partial hydration — send zero JavaScript by default, then selectively hydrate only the interactive components that justify the framework overhead.