Why 'use client' Does Not Make Your Whole App Client-Side in Next.js
A common worry is that wrapping a layout in a client-component theme provider converts the entire app into client-side React. The article explains that 'use client' marks a boundary following the import graph, not the rendered tree. Children passed as props from a Server Component stay on the server, so pages keep their server-side data fetching and ship no extra JavaScript. Importing a server component inside a client file, however, pulls it into the client bundle and can break builds or add weight. The recommended practice is to place 'use client' on the smallest interactive piece rather than entire pages.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in