79197920

Date: 2024-11-17 19:00:38
Score: 1
Natty:
Report link

There is documentation about Asynchronous Page in the Next.js:

https://nextjs.org/docs/app/building-your-application/upgrading/version-15#asynchronous-page

Try that approach, which is in the Next.js documentation:

export default async function Challenge(
 props: {
  params: Promise<{ slug: string }>;
 }
) {
 const params = await props.params;
 const productID = params.slug[1];
 // const productID = params.slug;
 // other code here
}
Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: yusufie