params / searchParams types

next/route-paramserrornextjs-16correctness

Why it matters

Since Next.js 15, params and searchParams are Promises, and their keys come from the route's dynamic segments ([id] → string, [...slug] → string[]).

Fix

Type them as Promise<{ … }> with exactly the route's segment names, or use the generated PageProps<"/route"> helper.

Credit

  • From the Next.js team

    Made params and searchParams asynchronous in Next.js 15 and documents typing them as Promises, with PageProps helpers.

References

See it