Next.js Discord

Discord Forum

Trigger rebuild on a server component instead of the whole page

Unanswered
Pteromalid wasp posted this in #help-forum
Open in Discord
Pteromalid waspOP
Currently I am having the following structure
<SeverCompA>
  <ClientCompA />
<ServerCompA>

<SeverCompB>
  <ClientCompB />
<ServerCompB>

<SeverCompC>
  <ClientCompC />
<ServerCompC>

Let's say I have a userEvent in ClientCompA, I want only the ServerCompA refetch the data and use prefetchQuery and useSuspenseQuery to pass it to ClientCompA. Or using props to pass.
If I used router.refresh(), all the Server Component will fetch the data again. I have tried the revalidate() function, but it doesn't rebuild.

0 Replies