Is revalidatePath('/', 'layout') supposed to revalidate client components too?
Unanswered
South Polar Skua posted this in #help-forum
South Polar SkuaOP
As the title says, is revalidatePath('/', 'layout') supposed to revalidate client components' data too? If not, what is the correct way to revalidate client components?
I have a sidebar, which is a client component with some UI interactions, and a small card on it that displays data as a client component. However, after a certain server action is fired, this data becomes stale and does not refetch with revalidatePath('/', 'layout').
I have a sidebar, which is a client component with some UI interactions, and a small card on it that displays data as a client component. However, after a certain server action is fired, this data becomes stale and does not refetch with revalidatePath('/', 'layout').
2 Replies
revalidatePath is just sever side cache, and if its ran in server action it gives client new page content (but does not mess with client state like useState)
if you want to reset those, you can use the usePathname hook and useEffect to change the useState value on change to pathname