From c2da74c6622ff44fbdc85a984d79f661f1b59299 Mon Sep 17 00:00:00 2001 From: shadcn Date: Sat, 5 Nov 2022 11:11:26 +0400 Subject: [PATCH] fix: force a cache invalidation using router.refresh --- components/post-create-button.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/post-create-button.tsx b/components/post-create-button.tsx index ee283ce..15ae49a 100644 --- a/components/post-create-button.tsx +++ b/components/post-create-button.tsx @@ -42,6 +42,9 @@ export function PostCreateButton({ const post = await createPost() + // This forces a cache invalidation. + router.refresh() + router.push(`/editor/${post.id}`) }