Next.js·Next.js essentials

Server data

Server Components can fetch directly without a client-side effect.

Intermediate 10 min read Lesson 3 of 150 Challenge included
What you will be able to do
  • Mark components async.
  • Fetch on the server.
  • Cache deliberately.

In plain English

Server Components can fetch directly without a client-side effect.

  • Mark components async.
  • Fetch on the server.
  • Cache deliberately.
app/courses/page.tsxJavaScript
export default async function Courses() {
  const res = await fetch('https://example.com/api/courses', { cache: 'no-store' })
  const courses = await res.json()
  return <ul>{courses.map((c) => <li key={c.slug}>{c.title}</li>)}</ul>
}
Your turn

Explain it back

Easy

Answer from memory: Where does a Server Component fetch data?

TEXT · starter
Your answer…
Check your understanding before moving on.
Knowledge checkQuestion 1

Where does a Server Component fetch data?

Select an answer to continue
Study tools

Make it yours.

Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.

Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign in
Finished reading?

Lock in what you just learned.

Mark this lesson complete to save your place and move one step closer to the certificate.

Next: Route handlers
Lesson 3 of 150 · 0% of course