Course contentsShow
← React
Lesson 1672 of 2,39640. Server-Side RenderingFree lesson

Client-Side Rendering (CSR): The SPA Default

Understanding pure CSR where React renders everything in the browser, and why it was the original React pattern.

Client-Side Rendering (CSR): The SPA Default

What you'll learn: How pure client-side rendering works and why it was React's original rendering pattern.

The Original React Pattern

Client-Side Rendering (CSR) is the approach that made React famous. In pure CSR, your server sends a minimal HTML shell—often just a <div id="root"></div>—and the browser downloads JavaScript bundles that execute in the client to render your entire application.

This is the pattern you get with createRoot:

import { createRoot } from 'react-dom/client';

const root = createRoot(document.getElementById('root'));
root.render(<App />);

The server HTML might look like this:

<!DOCTYPE html>
<html>
  <body>
    <div id="root"></div>
    <script src="/bundle.js"></script>
  </body>
</html>

Everything—routing, data fetching, rendering—happens in the browser after JavaScript loads and executes.

Why CSR Was the Default

CSR was revolutionary because it enabled Single Page Applications (SPAs): smooth, app-like experiences without page refreshes. It simplified deployment (just static files), made state management straightforward (everything's in JavaScript), and let developers build interactive interfaces without server complexity.

The tradeoff? Users see a blank page until JavaScript downloads, parses, and executes. Search engines initially struggled with CSR content. Time to First Contentful Paint was slower.

The Modern Context

All the SSR techniques you've learned—streaming, hydration, Server Components—exist to address CSR's limitations while preserving its interactivity. But CSR isn't obsolete: admin dashboards, authenticated apps, and tools where SEO doesn't matter often use pure CSR successfully.

Key Takeaway: Client-Side Rendering renders your entire app in the browser after JavaScript loads—it was React's original pattern and remains appropriate for apps where initial load speed and SEO aren't critical.