Next.js Discord

Discord Forum

Is there something like the new global PageProps and LayoutProps or should the user import ParamMap?

Unanswered
American Curl posted this in #help-forum
Open in Discord
American CurlOP
Hi,
migrating to the 15.5 typed routes and I'd like to also use that to type generateStaticParams.
Sadly there doesn't seem to be a generic type in the global declaration.

Meaning in the end i have to do
export async function generateStaticParams({
  params,
}: {
  params: ParamsOf<"/[locale]/[country]/foo/bar">;
}) {
  const country = params.country;


with importing ParamsOf manually from the generated .next/types/routes

3 Replies

chatgpt is going to give you the wrong answers for this in most cases as it still references old documentations, params needs to be awaited, However, refer to this.

also you have PageProps, LayoutProps, and RouteContext.

https://nextjs.org/docs/app/api-reference/file-conventions/page