Loading…
A short voice session: one question, one follow-up, then instant feedback — up to 5 minutes.
Keep data fetching and non-interactive rendering on the server and push 'use client' down to the smallest interactive leaves; only serializable props and server-rendered children can cross the boundary.
Server Components run only on the server, can access databases and secrets, and send no JavaScript for themselves to the browser. Client Components are needed for state, effects, event handlers and browser APIs. Marking a high-level layout with 'use client' turns its whole imported subtree into client code and inflates the bundle, so it is better to keep pages and data loading on the server and mark small interactive pieces as client components. Props passed from server to client must be serializable, such as plain objects, strings, dates and promises, but not functions other than Server Actions. A server component can still be passed into a client component as children, which keeps it server-rendered.