Server Components Can Be Async Functions
What you'll learn: How server components uniquely allow async/await syntax directly in the component body, eliminating loading state boilerplate.
The Fundamental Difference
In traditional React, you couldn't make a component function async. You had to use useEffect with loading states, or more recently, the use() hook. Server components break this rule entirely: they can be async functions.
This means you can await promises directly in the component body, before returning JSX. The server waits for the promise to resolve, then sends the complete result to the client.
How It Works
// ✅ Valid server component
async function ProductPage({ id }) {
// Await directly in the component body
const product = await fetchProduct(id);
const reviews = await fetchReviews(id);
return (
<div>
<h1>{product.name}</h1>
<p>{product.description}</p>
<ReviewList reviews={reviews} />
</div>
);
}
No useEffect. No useState for loading. No conditional rendering checks. The component simply waits for data before rendering.
Why Client Components Can't Do This
Client components run in the browser, where blocking the entire thread with await would freeze the UI. Server components run once on the server, where waiting for data is perfectly acceptable—the client just receives the final HTML-like result.
Think of it like ordering at a restaurant: the kitchen (server) can take its time preparing your meal, but the waiter (client) needs to stay responsive to other customers.
Key Takeaway: Server components can be async functions, allowing you to await data directly in the component body without loading states—something impossible in client components.