Back to Insights

Frontend
React Server Components: A Practical Guide
6 min read919 views
How React Server Components change the way we think about data fetching and component architecture in Next.js applications.
# React Server Components: A Practical Guide
React Server Components (RSC) represent a fundamental shift in how we build React applications.
## What Are Server Components?
Server Components run exclusively on the server and can directly access databases and file systems.
```tsx
async function UserProfile({ userId }: { userId: string }) {
const user = await db.user.findUnique({ where: { id: userId } });
return
{user.name}
;
}
```
## When to Use Client Components
Use Client Components when you need event handlers, browser APIs, or React hooks.