MSK Institute LogoMSK.Institute
HomeCourses
Book Free Demo➔Sign In
Free Demo➔
MSK Institute LogoMSK.Institute

Leading computer training academy in Shikohabad for software engineering, Python, web development, and digital literacy.

ISO 9001:2015 Certified Center
Follow & Connect
4.9

Programs & Admissions

  • All CoursesCatalog
  • Learning PathsRoadmaps
  • Student ProjectsShowcase
  • Live Classes & ScheduleLive
  • Upcoming Batches
  • Campuses & LocationsHub
  • Verify Certificates
  • Book Free Demo Class

Resources & Tools

  • Free Online Mock TestsAll Tests
  • NIELIT CCC Mock TestFree
  • Course & Career FinderQuiz
  • Study Material Hub
  • All MSK ToolsHub
  • Keyboard ShortcutsNew
  • TypeQuest Speed LabTyping
  • MSK Code PlaygroundCode
  • Interactive Tutorials
  • Quick Cheatsheets

Institute & Contact

  • About MSK Institute
  • Careers & InternshipsHiring
  • Publications & Blogs
  • Gali No. 3, Near Gyan Jyoti Public School,
    Adarsh Nagar, Shikohabad, Uttar Pradesh 283135
  • +91 83930 42166
  • mskshikohabad@gmail.com
  • Hours:Mon – Sat: 8:00 AM – 7:00 PM | Sun: 10:00 AM – 2:00 PM
  • 4.9 ★(38 Google Reviews)
© 2026 MSK Institute. All rights reserved.•Privacy Policy•Terms of Service•Disclaimer•Contact Us

Shikohabad's Leading Computer & Coding Academy

Home
Courses
Live
Material
React Server Components (RSC) Architecture0%
Study Materials
React.js for AdvancedProgress 0%
1.1Control Props and Inversion of Control Pattern1.2State Reducer Pattern in Advanced React1.3Prop Getters and Flexible Design Systems1.4Headless UI Architecture and Accessibility Primitives
5.1Architecture of Server-Side Rendering vs Client-Side Rendering5.2React 18 Streaming SSR and Selective Hydration5.3React Server Components (RSC) Architecture5.4Next.js App Router and Server-First Paradigms
HomeTutorialsReact.js for AdvancedReact Server Components (RSC) Architecture
Next.js App Router and Server-First Paradigms

React Server Components (RSC) Architecture

Beginner12 min read•Updated: 2026-11-18•By Er. Sumit Kumar (MSK Institute)
Study MaterialsCheatsheet

1. The Paradigm Shift: React on the Server

For over a decade, every React component was a Client Component: it executed in the browser, was bundled into client JavaScript, and could hold local state and event handlers.

React Server Components (RSC) represent the most significant architectural evolution in React history.

In RSC architecture:

Components execute EXCLUSIVELY ON THE SERVER during the build or request time. Their code NEVER downloads to the user's browser, resulting in ZERO client bundle size!
1Client Component (.jsx / 'use client'):
2- Downloaded to browser in JS bundle
3- Executed on client
4- Can use useState, useEffect, onClick
5- Bundle Size: Adds to client JS download!
6 
7React Server Component (.jsx - Default in Next.js App Router):
8- Executed ONLY on server
9- NEVER downloaded to browser
10- Can access database, files, and secrets directly!
11- Bundle Size: 0 KB added to client JS!

2. Direct Database & Backend Access

Because Server Components run strictly on the backend, they can query databases, read file systems, and use private API keys directly inside the component function without creating an intermediary REST API endpoint:

1// A React Server Component (Runs ONLY on server!)
2import db from '@/lib/database';
3 
4export default async function StudentRoster() {
5 // Query database directly! No fetch(), no useEffect(), no loading spinner!
6 const students = await db.query('SELECT * FROM students ORDER BY enrolled_at DESC');
7 
8 return (
9 <div className="roster-view">
10 <h2>Enrolled Students ({students.length})</h2>
11 <ul>
12 {students.map((s) => (
13 <li key={s.id}>{s.name} — {s.course}</li>
14 ))}
15 </ul>
16 </div>
17 );
18}

3. The 'use client' Directive

In RSC architecture (as implemented in Next.js App Router), all components are Server Components by default.

If a component needs interactivity:

  • React state (useState, useReducer)
  • Lifecycle effects (useEffect)
  • Browser APIs (window, localStorage, geolocation)
  • Event listeners (onClick, onChange)

You declare the 'use client' directive at the very top of the file:

1'use client'; // Marks this file and its imports as a Client Component boundary!
2 
3import React, { useState } from 'react';
4 
5export default function LikeButton({ initialLikes }) {
6 const [likes, setLikes] = useState(initialLikes);
7 
8 return (
9 <button onClick={() => setLikes(l => l + 1)}>
10 ★ {likes} Likes
11 </button>
12 );
13}

4. Composing Server and Client Components

The golden rule of RSC composition:

  • Server Components can import and render Client Components.
  • Client Components CANNOT import Server Components directly!
  • However, a Client Component can accept a Server Component as a children prop passed down from a parent Server Component!
1// Server Component (Parent):
2export default async function Page() {
3 const data = await db.getData();
4 
5 return (
6 // ClientComponent receives ServerComponent as children!
7 <ClientModalWrapper>
8 <ServerRenderedContent data={data} />
9 </ClientModalWrapper>
10 );
11}

Interactive Quiz• Knowledge Check

Practice Quiz

Question 1
What is the primary characteristic of a React Server Component (RSC)?
Question 2
What directive marks a component file as an interactive Client Component in the React Server Component architecture?
Question 3
Can a React Server Component use the useState or useEffect hooks?
Question 4
How does a Server Component fetch data from a database?
Question 5
How can an interactive Client Component (like a modal wrapper) contain a Server Component that queries the database?
Next Lesson

Next.js App Router and Server-First Paradigms

Continue learning with hands-on practice, examples, and exercises in the upcoming topic.

Related Lessons

Previous LessonNext Lesson
React 18 Streaming SSR and Selective HydrationNext.js App Router and Server-First Paradigms

Practice Quiz

Test your understanding of this lesson with 5 questions. Each question has one correct answer.

Mentor-Led Practical Training

Master React.js for Advanced with Hands-On Projects

Practice in live mentor-led sessions with real projects, mock tests, and verifiable certification at MSK Institute.

View Full CourseBook Free Demo
PreviousNext
PreviousPrevNext