Zum Hauptinhalt springen
IT Security NachrichtenMFA Won't Save You From OAuth Consent Abuse(18.09.2026 um 20:15 Uhr)
IT Security NachrichtenSicher Parken: Smarter Brandschutz im Krügelpark Stein - Protector(18.09.2026 um 15:49 Uhr)
IT Security NachrichtenArctic Wolf hat neue MDR-Services für MSPs im Angebot - IT-Markt(18.09.2026 um 17:08 Uhr)
IT Security NachrichtenCyber-Angriffe treffen deutsche KMU härter als gedacht - it-daily.net(18.09.2026 um 19:49 Uhr)
IT Security NachrichtenInfoguard-Threat-Intelligence-Report - Cyberrisiko Iran(18.09.2026 um 20:21 Uhr)
IT Security NachrichtenNeues Defender-Update beendet ständige falsche Virenschutz-Meldungen(18.09.2026 um 20:11 Uhr)
IT Security NachrichtenMFA Won't Save You From OAuth Consent Abuse(18.09.2026 um 20:15 Uhr)
IT Security NachrichtenSicher Parken: Smarter Brandschutz im Krügelpark Stein - Protector(18.09.2026 um 15:49 Uhr)
IT Security NachrichtenArctic Wolf hat neue MDR-Services für MSPs im Angebot - IT-Markt(18.09.2026 um 17:08 Uhr)
IT Security NachrichtenCyber-Angriffe treffen deutsche KMU härter als gedacht - it-daily.net(18.09.2026 um 19:49 Uhr)
IT Security NachrichtenInfoguard-Threat-Intelligence-Report - Cyberrisiko Iran(18.09.2026 um 20:21 Uhr)
IT Security NachrichtenNeues Defender-Update beendet ständige falsche Virenschutz-Meldungen(18.09.2026 um 20:11 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Server side Rendering Vs Server components. Explanation with example.

Context: Evolution of Rendering Approaches

Client-Side Rendering (CSR)

  • How it works: Everything is rendered in the browser.
  • Pros: Fast interactivity.
  • Cons: Heavy initial load and poor SEO.

Server-Side Rendering (SSR)

  • How it works: Content is rendered on the server and sent to the client, where hydration enables interactivity.
  • Pros: Improved SEO.
  • Cons: Still requires JavaScript in the browser.

Static Site Generation (SSG)

  • How it works: Content is pre-rendered at build time.
  • Pros: Fast initial load.
  • Cons: Limited content flexibility.

Incremental Static Regeneration (ISR)

  • How it works: Content is rendered statically and revalidated at predefined intervals.
  • Pros: Combines static performance with periodic updates.
  • Cons: Updates aren’t real-time.

React Server Components (RSC)

  • How it works: Content is rendered on the server with no need for JavaScript on the client (except for client components).
  • Pros:
    • Smaller bundle size
    • Faster initial load
    • Interactivity supported via client components

Comparing SSR and RSC

SSR Example:

In this example, we have an application that displays the title and description of posts.

  1. Clone the repository:
   git clone https://github.com/hoshdev/poc-nextjs-rsc
  1. Install dependencies:
   npm install
  1. Switch to the 1-rcc branch:
   git checkout 1-rcc
  1. Open App.tsx.

You’ll notice it's a client component (using the use client directive at the top).

In this example, we retrieve post content inside a useEffect:

   useEffect(() => {
     console.log("browserUseEffect", typeof window !== "undefined");
     getPosts()
       .then((posts) => setPosts(posts))
       .catch((err) => console.log("err", err));
   }, []);
  1. Observe: All JavaScript is sent to the client.

SSR Example

It’s a simple example with a small amount of data, but imagine this in a real application. Here's the flow:

  • The content is created on the server (the first console.log is false).
  • Then, it's sent to the browser (the next console.log is true).
  • Finally, once hydrated, the component becomes interactive, and the console.log inside the useEffect is displayed in the browser.

RSC Example:

  1. Switch to the 2-rsc branch:
   git checkout 2-rsc
  1. In App.tsx, you’ll see a server component.

It doesn't have the use client directive at the top. Since it's a server component, it runs on the server.

You can use async/await to retrieve data:

   const PostsPage = async () => {
     const posts = await getPosts();
   };
  1. Note: You can access any Node.js feature in server components, like interacting with a database, the file system, or using process.env.

  2. Observe: No JavaScript for server components is sent to the client. Compare this with the SSR example screenshot.

RSC Example

Adding Interactivity in RSC:

If you need interactivity, you can include client components. These are sent to the browser, allowing for dynamic behavior.

  1. Switch to the 3-rsc-rcc branch:
   git checkout 3-rsc-rcc
  1. Here, we added a client component that handles interactivity. So, the JavaScript for this component is sent to the browser,l but just client component.

Some Final Tips

Server Environment:

  • Leverage Node.js features: You can use Node.js-specific functionality like async/await, process.env, and more.
  • No hooks in server components: You cannot use React hooks (such as useState or useEffect) in server components since they are meant to be client-side only.

Event Handling:

  • Use client components for interactivity: Server components are responsible for rendering, but for event handling (like clicks or form submissions), you must use client components to manage the interactivity.

By understanding the evolution of rendering approaches—from CSR to SSR, SSG, ISR, and RSC—you can make more informed decisions about the architecture of your application, improving both performance and SEO.

Need further details? Contact me

Let’s learn by doing, collaborating and facing real project challenges together learning from each other! Learn More

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Server side Rendering Vs Server components. Explanation with example.

Thematisch verwandte Begriffe: Server, side, Rendering, components · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-61591 | djust provides Phoenix LiveView-style reactive server-side rendering for…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Rechts: Artikel Ziehen Links: RSS
Hoch: nächster Artikel Runter: zurück / schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Rechts: Original Links: RSS-Ansicht
↗ Original-Quelle
Social Reaktionen Stimme abgeben (+5 Karma)
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick