79370391

Date: 2025-01-20 05:59:21
Score: 1
Natty:
Report link

As noted in the breaking changes for Next.js 15, both page/layout params and searchParams will now be of type Promise<...>. This and other breaking changes can be found here: https://nextjs.org/docs/app/building-your-application/upgrading/version-15#asynchronous-page.

For your use case,

interface PageProps {
  params: Promise<{
    slug: string;
  }>
}

export default async function PropertyDetailPage({ params }: PageProps) {
  const { slug } = await params
  const property = await getPropertyBySlug(slug);
  ...
}

should do the trick!

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Nicholas Dullam