Tutorials Courses Interview Prep (100 Q&A) AI Tools (50) Developer Tools (50) Tracks Pricing Plans Blog & Articles Contact Us
Next.js 15 App Router Architecture 18 mins read Free Lesson

React Server Components (RSC) vs Client Components

Learn why components default to Server Components, when to opt into Client Components with 'use client', and bundle optimization.

Server Components vs Client Components

By default, all components in Next.js App Router are React Server Components (RSC). They execute strictly on the server and transmit zero JavaScript bytes to the client bundle!

// app/components/ClientCounter.tsx
'use client'; // Opts into client-side interactivity

import { useState } from 'react';

export default function ClientCounter() {
    const [count, setCount] = useState(0);
    return <button onClick={() => setCount(count + 1)}>Clicks: {count}</button>;
}