Skip to content
Home Tutorials Roadmaps Courses
Log in Join free
Tutorials React React Server Components
React Intermediate FREE

React Server Components

Lesson 1 of 17 Intermediate Interactive

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;