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!