From 7f7a2f4edd29869c6b9df611970881e750bbb127 Mon Sep 17 00:00:00 2001 From: Enguerrand Ozano Date: Sat, 28 Feb 2026 19:43:43 +0100 Subject: [PATCH] Fix params/searchParams types for Next.js app router --- app/blog/[slug]/page.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/blog/[slug]/page.tsx b/app/blog/[slug]/page.tsx index 3de9972..1873fc9 100644 --- a/app/blog/[slug]/page.tsx +++ b/app/blog/[slug]/page.tsx @@ -6,7 +6,7 @@ import Footer from "@/components/marketing/Footer"; import ScrollReveal from "@/components/animations/ScrollReveal"; import { getBlogPost, getBlogPosts, getSiteConfig } from "@/lib/content"; -type Props = { params: { slug: string } }; +type Props = { params: Promise<{ slug: string }> }; // Corps des articles — FUTURE: champ rich text Payload CMS const articleContenu: Record = { @@ -69,7 +69,7 @@ export async function generateStaticParams() { export async function generateMetadata( { params }: Props ): Promise { - const { slug } = params; + const { slug } = await params; const [post, config] = await Promise.all([getBlogPost(slug), getSiteConfig()]); if (!post) return { title: "Article introuvable" }; return { @@ -80,7 +80,7 @@ export async function generateMetadata( } export default async function BlogArticlePage({ params }: Props) { - const { slug } = params; + const { slug } = await params; const post = await getBlogPost(slug); if (!post) notFound();