Skip to content

Commit

Permalink
fix: missing await, missing type Promise (#73088)
Browse files Browse the repository at this point in the history
Hi, Team.
It seems Promise is missing when defining params type.

---------

Co-authored-by: hyungji <hj@doodlin.co.kr>
Co-authored-by: Maikel <maikel.van.dort@gmail.com>
  • Loading branch information
3 people authored and wyattjoh committed Nov 28, 2024
1 parent a038019 commit 54e9dc7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ export async function generateStaticParams() {
}

export default async function Page({ params }) {
const post = await fetch(`https://api.vercel.app/blog/${params.id}`).then(
(res) => res.json()
const { id } = await params
const post = await fetch(`https://api.vercel.app/blog/${id}`).then((res) =>
res.json()
)
return (
<main>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ export async function generateStaticParams({
export default function Page({
params,
}: {
params: { category: string; product: string }
params: Promise<{ category: string; product: string }>
}) {
// ...
}
Expand Down

0 comments on commit 54e9dc7

Please sign in to comment.