Skip to content

What are React Server Components

Key idea:

React Server Components (RSC) — components that render exclusively on the server with zero JS bundle on the client. Direct DB, filesystem, secrets access in the component (no API layer). Next.js App Router (2023+) is the flagship implementation. Async by default: you can await fetch(...) right in the component. Client components are marked with a "use client" directive.

Below: details, example, related terms, FAQ.

Check your site's speed →

Details

  • Server Component (default): async, direct DB access, zero client JS
  • Client Component: "use client" directive, hydration required
  • Streaming: HTML chunks stream as they are ready → faster TTFB
  • Server Actions: form handlers on the server without an API route
  • Data cache: fetch() automatically deduplicated + cached

Example

async function UserCard({ id }) {
  const user = await db.users.findById(id);
  return <div>{user.name}</div>;
}

Related Terms

How React Server Components Improve Performance

React Server Components (RSC) significantly enhance performance by minimizing the amount of JavaScript sent to the client. Since RSCs are rendered server-side, they eliminate the need for a client-side JavaScript bundle, which traditionally includes both the component logic and additional overhead. This results in faster load times and a more responsive user experience.

When a user requests a page, the server handles the rendering of RSCs, fetching data directly from the database or filesystem. This direct access reduces latency associated with API calls, allowing for quicker data retrieval. The server sends only HTML to the client, which is immediately usable, rather than waiting for JavaScript to be parsed and executed.

Furthermore, because RSCs are asynchronous by default, developers can use await to fetch data directly within the component, streamlining the data fetching process. For example:

async function MyComponent() { const data = await fetchData(); return 
{data}
; }

This approach not only simplifies the code but also optimizes performance by allowing concurrent data fetching and rendering.

In summary, React Server Components improve performance by:

  • Reducing the JavaScript bundle size on the client
  • Enabling direct server access to data sources
  • Streamlining asynchronous data fetching

Common Use Cases for React Server Components

React Server Components (RSC) are particularly suited for specific use cases where server-side rendering can provide significant advantages. Here are some common scenarios:

  • Data-Heavy Applications: Applications that rely on substantial data fetching, such as dashboards or content management systems, benefit from RSCs as they can retrieve and render data directly from the server without the overhead of API calls.
  • SEO Optimization: Since RSCs render HTML on the server, search engines can crawl the content more effectively, improving SEO rankings. This is crucial for public-facing websites where visibility is paramount.
  • Dynamic Content Rendering: Websites requiring frequent updates or dynamic content can utilize RSCs to serve the latest information without needing a full page reload, enhancing user engagement.
  • Authentication and Authorization: RSCs can manage user sessions more securely by accessing session data directly on the server, reducing the risk of exposing sensitive information to the client.

For developers looking to implement RSCs, the following example demonstrates how to create a simple server component that fetches user data:

async function UserProfile({ userId }) { const user = await fetchUserData(userId); return 
{user.name}
; }

This component directly accesses the user database using the fetchUserData function, providing a seamless user experience while minimizing client-side processing.

Integrating React Server Components with Next.js

Next.js is the leading framework for implementing React Server Components (RSC) due to its built-in support for server-side rendering and routing. To integrate RSCs into a Next.js application, developers can follow these steps:

  1. Setup Next.js: If you haven't already, create a new Next.js application using the following command:
  2. npx create-next-app@latest my-app
  3. Create a Server Component: Inside the app directory, create a new file, e.g., MyComponent.jsx, and define your server component:
  4. export default async function MyComponent() { const data = await fetchData(); return 
    {data}
    ; }
  5. Use the Component: Integrate your server component into a page or another component. For example, in page.jsx:
  6. import MyComponent from './MyComponent'; export default function Page() { return ; }
  7. Run the Application: Start your Next.js application using:
  8. npm run dev

    Your server component will now be rendered server-side, providing the advantages of RSCs.

In summary, integrating RSCs with Next.js is straightforward, leveraging the framework's capabilities to enhance performance and user experience. By following these steps, developers can create efficient, data-driven applications that utilize the full potential of React Server Components.

PerformanceOverall speed score 0-100
Core Web VitalsLCP, FID, CLS — Google metrics
Page SizeSize of HTML, CSS, JS, images
RecommendationsSpecific tips for improvement

Why teams trust us

Lighthouse
analysis engine
CWV
Core Web Vitals
4
Lighthouse categories
Precise
recommendations

How it works

1

Enter page URL

2

Lighthouse analyzes

3

Get CWV scores & tips

Why Does Site Speed Matter?

Page load speed directly impacts conversion, SEO rankings, and user satisfaction. Google uses Core Web Vitals as a ranking factor. Every extra second of load time cancost up to 7% in conversions.

Lighthouse Analysis

Google Lighthouse-based analysis: Performance, Accessibility, Best Practices, SEO.

Core Web Vitals

LCP (rendering), FID (interactivity), CLS (visual stability) — key Google metrics.

Resource Analysis

Breakdown by type: HTML, CSS, JavaScript, images, fonts. Size, request count, blocking resources.

Actionable Advice

Specific recommendations with savings estimates: image compression, caching, minification, etc.

Mobile vs Desktop

Mobile
  • Tested on Moto G Power emulation (slow CPU)
  • Network: 4G (1.6 Mbps, 150ms RTT)
  • Stricter speed scoring
  • Google indexes mobile-first
  • Priority for SEO optimization
Desktop
  • High CPU performance
  • Fast connection without throttling
  • Scores typically 20-40 points higher
  • Important for B2B and corporate sites
  • Use for baseline comparisons

Who uses this

SEO

Core Web Vitals for rankings

Developers

performance optimization

Marketers

speed = conversions

DevOps

performance regression

Common Mistakes

Unoptimized imagesImages can be up to 70% of page weight. Use WebP/AVIF and lazy loading.
Render-blocking JS in &lt;head&gt;Scripts without async/defer block rendering. Move to end or add attribute.
No static asset cachingWithout Cache-Control, the browser reloads CSS/JS on every visit.
Too many HTTP requestsEach request adds latency. Bundle files, use sprites, or inline critical CSS.
Missing compression (gzip/brotli)Compression reduces text resource size by 60-80%. Enable brotli on the server.

Best Practices

Optimize imagesWebP for photos, SVG for icons. loading="lazy" for images below the fold.
Enable brotli compressionBrotli is 15-20% more efficient than gzip. Configure in nginx: brotli on;
Set up cachingStatic: Cache-Control: max-age=31536000, immutable. HTML: max-age=0, s-maxage=60.
Preload critical resources<link rel="preload"> for fonts and CSS. Reduces LCP by 200-500ms.
Test regularlySpeed degrades over time. Check after each deploy and monthly.

Get more with a free account

Speed check history, competitor comparison and PageSpeed monitoring.

Sign up free

Learn more

Frequently Asked Questions

RSC vs SSR?

SSR — HTML rendered on server, then full JS bundle hydrates. RSC — component code stays on server; client gets only a payload without JS.

Do all React frameworks support it?

Next.js (App Router) — first. Remix, TanStack Start follow. Vanilla React does not support it without a framework.

Can I use hooks?

In Server Components — no (no state). In Client Components — yes (useState, useEffect, etc.).

Try the live tool that powered this guide

Free plan — 10 monitors, checks every 5 min, no card required. Upgrade for 1-minute interval and multi-region monitoring.