I feel this is a tough topic. It’s been something I have been trying to wrap my head around since I have started working more intimately with Next.js. On the surface it’s straightforward but when you start to work with each there’s some complexities.

Why would I want something to be a client or a server component?

‘use client’

Mark the component with 'use client'

These components render in the browser, the client.

React is often used with Next.js. React hooks, like useState will only work in a client component. This is because React needs to interact with the DOM. The DOM doesn’t exist on the server.

Performance is not the priority with client components. The priority is interactivity.

Client Components can lead to slower load times due to larger file sizes. Because the HTML and minified JavaScript (including any library code) are bundled and sent to the client, this "heavier" payload takes longer to download and parse, delaying the time it takes for the page to become interactive.

‘use server’