revalidateTag, but for server actions
Answered
Northeast Congo Lion posted this in #help-forum
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.
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.
1 Reply
@Northeast Congo Lion 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.
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.
Answer