Next.js · Junior · Question 35 of 75

How do you load data in a server component?

Explanation

Server components can be async and access data directly - APIs, ORMs, the file system - without sending secrets to the browser. Calling your own Route Handler from a server component is an unnecessary network round trip. Hooks aren't available in server components.

Further reading

Problem with a question

Next.js · Junior · question 35

Test yourself

Take the Next.js · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz