Skip to content

Commit

Permalink
Update Page component to handle async params in TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Koech authored and Kevin Koech committed Jan 9, 2025
1 parent b492483 commit 2a2c780
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/techlabblog/app/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 2a2c780

Please sign in to comment.