How do I force a revalidatePath() on a layout, but I need to do it without a 'next visit'.
Unanswered
Bumble bee posted this in #help-forum
Bumble beeOP
I'm revalidating a path, for a layout, like
Because I don't redirect / change route, the parent layout doesn't actually refetch stuff until i change route.
any solution around this, ideally i want the layout to revalidate without changing routes back and forth.
revalidatePath('/thread-name/run-name/', 'layout') while on a route like [thread-name]/[run-name]/[message-name]Because I don't redirect / change route, the parent layout doesn't actually refetch stuff until i change route.
any solution around this, ideally i want the layout to revalidate without changing routes back and forth.
3 Replies
Siberian Flycatcher
Hey 👋
Where do you call revalidatePath? In API route or a Server Action?
Where do you call revalidatePath? In API route or a Server Action?
i don't really understand the question, but does template.ts work? https://nextjs.org/docs/app/building-your-application/routing/pages-and-layouts#templates
Siberian Flycatcher
I mean, where exactly do you call this
revalidatePath('/thread-name/run-name/', 'layout')? In Server Action or API route? Can you show some code?