React Server Components vs. Astro Islands: When to Use Each Pattern
I've shipped production code with both React Server Components (RSC) and Astro Islands. They solve the same problem—reducing JavaScript sent to browsers—but through completely different philosophies. Most developers pick wrong because they don't understand why each exists.
Let me be direct: Astro Islands is better for content-heavy sites with scattered interactivity. React Server Components are better for apps that need frequent server-client synchronization. If you're building a SaaS dashboard, RSC wins. If you're building a marketing site with a contact form, Astro wins. The guilt-free pick depends on your actual constraints, not hype.
The Fundamental Difference
Astro Islands treat your page as mostly static HTML with JavaScript "islands" of interactivity. The framework is optional per component. You can ship zero JavaScript if you want.
React Server Components treat your entire app as React, but some of it runs on the server. The framework is mandatory. You're always shipping React runtime to the browser.
Here's what this means in practice:
Astro: Static-First Architecture
---
// src/pages/blog/[slug].astro
import { getPost } from '../lib/posts';
import CommentForm from '../components/CommentForm.jsx';
const { slug } = Astro.params;
const post = await getPost(slug);
---
<article>
<h1>{post.title}</h1>
<p>{post.content}</p>
<!-- This component loads React only when needed -->
<CommentForm client:load postId={post.id} />
</article>
The HTML renders at build time or request time. The CommentForm component loads React only in the browser, and only when that island mounts. The rest of the page is dead-simple HTML.
React Server Components: Everything is React
// app/blog/[slug]/page.tsx
import { getPost } from '@/lib/posts';
import CommentForm from '@/components/CommentForm';
export default async function BlogPost({ params }) {
const post = await getPost(params.slug);
return (
<article>
<h1>{post.title}</h1>
<p>{post.content}</p>
{/* This is a Client Component, explicitly marked */}
<CommentForm postId={post.id} />
</article>
);
}
// components/CommentForm.tsx
'use client';
export default function CommentForm({ postId }) {
// Client component with hooks, state, etc.
}
The entire page tree is React. The server renders what it can, sends HTML to the browser, and hydrates the client components. React runtime is always in your bundle.
When I Pick Astro
I chose Astro for CitizenApp's marketing site and docs. Here's why:
Content scales without framework overhead. Our docs have 200+ pages. Astro builds them to static HTML in seconds. Serving static HTML is cheap.
Islands are fine-grained. We have a demo calculator, a pricing toggle, and a contact form. Three JavaScript islands. Everything else is HTML. Our marketing bundle is ~15KB gzipped.
Zero hydration mismatch. With Astro, there's no hydration—the HTML is already there. No "flash of unstyled content" on slow networks.
---
// components/PricingToggle.astro
import ToggleButton from './ToggleButton.jsx';
const plans = [
{ name: 'Starter', monthly: 29, annual: 290 },
{ name: 'Pro', monthly: 99, annual: 990 },
];
---
<div class="pricing-section">
{plans.map(plan => (
<div key={plan.name}>
<h3>{plan.name}</h3>
<p class="price">${plan.monthly}/mo</p>
</div>
))}
{/* Only this button needs React */}
<ToggleButton client:idle />
</div>
The client:idle directive means: "Load this component's JavaScript after the page is idle." It's a lazy load hint that respects the user's network.
When I Pick React Server Components
For CitizenApp's actual app—the dashboard where users manage campaigns—RSC is the right choice.
-
Constant server-client dialogue. Users click buttons, forms submit, data updates. RSC lets me write this as a single component with
'use server'functions, keeping code co-located and reducing API churn.
// app/campaigns/[id]/editor.tsx
import CampaignForm from '@/components/CampaignForm';
export default async function CampaignEditor({ params }) {
const campaign = await db.campaigns.findUnique({
where: { id: params.id },
});
return (
<div>
<h1>Edit: {campaign.name}</h1>
<CampaignForm campaign={campaign} />
</div>
);
}
// components/CampaignForm.tsx
'use client';
import { updateCampaign } from '@/server/campaigns';
import { useTransition } from 'react';
export default function CampaignForm({ campaign }) {
const [pending, startTransition] = useTransition();
const handleSubmit = (formData) => {
startTransition(async () => {
await updateCampaign(campaign.id, formData);
// Server revalidates and re-renders parent
});
};
return (
<form action={handleSubmit}>
<input defaultValue={campaign.name} name="name" />
<button disabled={pending}>Save</button>
</form>
);
}
The beauty here: I call a server function directly from the client component. No REST endpoints. No /api/campaigns/[id] boilerplate. The server automatically revalidates after mutations.
Shared state patterns. Real apps need shared state between components. RSC makes this natural—fetch data on the server once, pass it down.
Framework features. Suspense, streaming, automatic code splitting. These work seamlessly in RSC because React controls the entire render tree.
The Gotcha I Missed
I initially thought Astro Islands were "strictly better for static content" and RSC were "strictly better for apps." That's wrong.
The real constraint is interactivity density. If your page has high interactivity relative to its total size, RSC makes sense. If it's 95% static with 5% interactive, Astro wins.
I also underestimated deployment complexity with RSC. On Vercel or Render, it's fine. But I tried to self-host an RSC app on a basic Node server and hit streaming issues. Astro, by contrast, can be a static export or a simple server—no special infrastructure needed.
For CitizenApp's internal tools dashboard, I switched from planning to use RSC to using Astro with client-side React. Why? I needed to deploy on restricted infrastructure without streaming support. Astro exported as static HTML + islands, problem solved.
Decision Matrix
| Factor | Astro | RSC |
|---|---|---|
| Mostly static content | ✅ Excellent | ⚠️ Overkill |
| Frequent mutations | ⚠️ API calls needed | ✅ Native |
| Low interactivity density | ✅ Perfect | ⚠️ Extra bytes |
| High interactivity density | ⚠️ Many islands | ✅ Unified |
| Simple deployment | ✅ Static export | ⚠️ Server needed |
| Shared server state | ⚠️ Props/APIs | ✅ Direct |
My Recommendation
Start with Astro if you're unsure. It's harder to migrate from RSC to Astro (you lose React runtime benefits) than to migrate from Astro to RSC (add more islands as needed). Astro is a safer bet for most projects because it forces you to think about what actually needs JavaScript.
If you're building a SaaS, a dashboard, or anything that lives in a browser tab for hours, RSC is worth the framework commitment.
Both beat the old Next.js Pages Router approach. We don't need to choose between them anymore—we can choose based on what we're actually building.
Top comments (0)