Next.js Discord

Discord Forum

revalidateTag, but for server actions

Answered
Northeast Congo Lion posted this in #help-forum
Open in Discord
Northeast Congo LionOP
Hi,

Is there a way to use revalidateTag to force re-rendering just of a specific part of a page, when using serverActions?

As far as I know, the revalidatePath just revalidates the whole page, while revalidateTag would just re-run the fetch calls which match the tags provided to revalidateTag while calling it.
Answered by joulev
Best you can do is to mark the fetches/db queries that construct that part of the page in a tag and revalidateTag it. You cannot manually revalidate any arbitrary components.
View full answer

1 Reply