Next.js
/Beginner
Server-Side Fetching
Definition
The practice of fetching data directly inside Server Components using standard `async/await` syntax, removing the need for `useEffect` or client-side loading spinners.
Explain Like I'm New
The old React way: Show a blank page, show a loading spinner, fetch data, show the data. The Next.js way: The server fetches the data *before* the page even loads. The user instantly sees the fully populated page. No spinners required.
Real World Example
Fetching a user's profile data from a secure database before rendering their dashboard. You don't want the user staring at a skeleton loader; you want the dashboard to appear instantly with their name on it.
Common Use Cases
- •SEO critical data
- •Secure database queries
- •Reducing client network waterfalls
Interactive Example
Loading Code Playground...
Interview Questions
basic
- Do you need to use `useEffect` to fetch data in a Server Component?
intermediate
- If a server-side fetch takes 3 seconds, what does the user see in their browser during those 3 seconds?