From 54e9dc710582527923ceaa60029dcda5f274d5e7 Mon Sep 17 00:00:00 2001 From: Hyungji <84058944+hyungjikim@users.noreply.github.com> Date: Sat, 23 Nov 2024 05:23:00 +0900 Subject: [PATCH] fix: missing await, missing type Promise (#73088) Hi, Team. It seems Promise is missing when defining params type. --------- Co-authored-by: hyungji Co-authored-by: Maikel --- .../02-data-fetching/04-incremental-static-regeneration.mdx | 5 +++-- .../03-api-reference/04-functions/generate-static-params.mdx | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/01-app/02-building-your-application/02-data-fetching/04-incremental-static-regeneration.mdx b/docs/01-app/02-building-your-application/02-data-fetching/04-incremental-static-regeneration.mdx index 7e2b5e2f509ff5..57ac33525e552a 100644 --- a/docs/01-app/02-building-your-application/02-data-fetching/04-incremental-static-regeneration.mdx +++ b/docs/01-app/02-building-your-application/02-data-fetching/04-incremental-static-regeneration.mdx @@ -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 (
diff --git a/docs/01-app/03-api-reference/04-functions/generate-static-params.mdx b/docs/01-app/03-api-reference/04-functions/generate-static-params.mdx index 89c553a0bfaf0c..65d60a575b3292 100644 --- a/docs/01-app/03-api-reference/04-functions/generate-static-params.mdx +++ b/docs/01-app/03-api-reference/04-functions/generate-static-params.mdx @@ -355,7 +355,7 @@ export async function generateStaticParams({ export default function Page({ params, }: { - params: { category: string; product: string } + params: Promise<{ category: string; product: string }> }) { // ... }