diff --git a/src/app/boards/[id]/page.tsx b/src/app/boards/[id]/page.tsx index dab7b80..e098736 100644 --- a/src/app/boards/[id]/page.tsx +++ b/src/app/boards/[id]/page.tsx @@ -1,11 +1,11 @@ import { PostList } from "@/app/components/PostList"; import { headers } from "next/headers"; -import React, { use } from "react"; -export default async function BoardDetail({ params, searchParams }: { params: Promise<{ id: string }>; searchParams: Promise<{ sort?: "recent" | "popular" }> }) { - const { id } = use(params); - const sp = use(searchParams); - const sort = sp?.sort ?? "recent"; +export default async function BoardDetail({ params, searchParams }: { params: any; searchParams: any }) { + const p = params?.then ? await params : params; + const sp = searchParams?.then ? await searchParams : searchParams; + const id = p.id as string; + const sort = (sp?.sort as "recent" | "popular" | undefined) ?? "recent"; // 보드 slug 조회 (새 글 페이지 프리셋 전달) const h = await headers(); const host = h.get("host") ?? "localhost:3000";