Unverified Commit 58b993c2 authored by Hyungji's avatar Hyungji Committed by GitHub

docs: missing `await` when using params (#73044)

parent 5a4de4cd
...@@ -48,7 +48,12 @@ export async function generateStaticParams() { ...@@ -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( const post: Post = await fetch(
`https://api.vercel.app/blog/${params.id}` `https://api.vercel.app/blog/${params.id}`
).then((res) => res.json()) ).then((res) => res.json())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment