Skip to content

Commit

Permalink
fix: missing await when using params
Browse files Browse the repository at this point in the history
  • Loading branch information
hyungjikim committed Nov 21, 2024
1 parent 5a4de4c commit 0955feb
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ export async function generateStaticParams() {
}))
}

export default async function Page({ params }: { params: { id: string } }) {
export default async function Page({
params,
}: {
params: Promise<{ id: string }>
}) {
const id = (await params).id
const post: Post = await fetch(
`https://api.vercel.app/blog/${params.id}`
).then((res) => res.json())
Expand Down

0 comments on commit 0955feb

Please sign in to comment.