Skip to content
Back to Blog
Deep Dive into React Server Components
[TECH]

Deep Dive into React Server Components

퀀텀점프클럽 정상록퀀텀점프클럽 정상록1 min read122 views

Deep Dive into React Server Components

Let's deeply understand how server components work.

Client vs Server Components

FeatureServer ComponentClient Component
Bundle SizeNot includedIncluded
DB AccessPossibleNot possible
StateNot possiblePossible

When to Use?

  • Server Components: Data fetching, sensitive information
  • Client Components: Interactions, event handlers
// Server component
async function ServerComponent() {
  const data = await db.query('SELECT * FROM posts')
  return <div>{data.map(post => <Post key={post.id} {...post} />)}</div>
}