Next.js Discord

Discord Forum

Clarification On Dynamic Server Components

Unanswered
Brown bear posted this in #help-forum
Open in Discord
Brown bearOP
Hi, just wanted to confirm i understood it correctly. Let's say I have the following
export default function ServerComponent() {
  const value = expensiveChildren{}
  return (
    <ClientComponent>
      {value}
    </ClientComponent>
  );
}

Does it make sense to make the ServerComponent dynamic?
import dynamic from 'next/dynamic';

const DynamicServerComponent = dynamic(() => import('./ServerComponent'), {
  loading: () => <p>Loading server stuff…</p>,
});

Will it still correctly do a full SSR and then serve the compiled static component?

0 Replies