Skip to content
Home Tutorials Roadmaps Courses Classroom Training Blog
Log in Join free
React Intermediate Free

React Server Components

Lesson 15 of 17 · Server Components 88%
1. Getting Started
What is React?
2. Components & Props
Components & Props
6. Performance & Testing
React.memo & Lazy Loading
7. Custom Hooks
Building Custom Hooks
8. State Management
Context API Redux Basics
9. Error Boundaries
Error Handling
10. Server Components
React Server Components
11. Next.js Introduction
Next.js Basics
12. Animations & Transitions
Framer Motion

Server Components run on the server and send rendered HTML to the client — reducing JavaScript bundle size.

Syntax

REACT
// This runs on the server
async function BlogPost({ id }) {
    const post = await db.posts.findById(id);
    return <article>{post.content}</article>;
}
Server Components (Next.js)
REACT
// This is a Server Component (default in Next.js App Router)
// No "use client" directive = runs on the server

async function PostList() {
    const res = await fetch("https://api.example.com/posts");
    const posts = await res.json();

    return (
        <ul>
            {posts.map(post => (
                <li key={post.id}>{post.title}</li>
            ))}
        </ul>
    );
}

export default PostList;

Up next

Next.js Basics

Lesson 16 of 17 · Next.js Introduction