From 2a2c780490e523e46823072127e9a07471cfe9f4 Mon Sep 17 00:00:00 2001 From: Kevin Koech Date: Thu, 9 Jan 2025 17:10:45 +0300 Subject: [PATCH] Update Page component to handle async params in TypeScript --- apps/techlabblog/app/[slug]/page.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/techlabblog/app/[slug]/page.tsx b/apps/techlabblog/app/[slug]/page.tsx index 178263844..cc370aec2 100644 --- a/apps/techlabblog/app/[slug]/page.tsx +++ b/apps/techlabblog/app/[slug]/page.tsx @@ -3,7 +3,8 @@ import { Section } from "@commons-ui/core"; import PostHeader from "@/techlabblog/components/PostHeader"; import { getPost } from "@/techlabblog/lib/data"; -export default async function Page({ params }: { params: { slug: string } }) { +export default async function Page(props: { params: Promise<{ slug: string }> }) { + const params = await props.params; const postModule = await getPost(params.slug); if (!(postModule && postModule.frontmatter)) {