params / searchParams types
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
- page.jsNext.js
- Dynamic Route SegmentsNext.js
- How to upgrade to version 15Next.js
- next-best-practices: Async patternsVercel (vercel-labs/next-skills)