Hybrid Example: Server + Client Components

Top Contributors (Server Component)

This data is fetched on the server

#1developit
developit

19 contributions

#2vinaykulk621
vinaykulk621

20 contributions

#3snyk-bot
snyk-bot

20 contributions

#4rafaelalmeidatk
rafaelalmeidatk

20 contributions

#5sergiodxa
sergiodxa

20 contributions

✅ Server-rendered at 1:51:56 AM

Client Component Example

This is a Client Component that uses useState hook

0

🖥️ This component is interactive and runs in the browser

🎯 Best Practices

  • Use Server Components by default - They're faster and more efficient
  • Use Client Components only when needed - For interactivity, hooks, browser APIs
  • Compose them together - Server Components can import Client Components
  • Keep Client Components small - Less JavaScript sent to the browser