nextjs
Installation
SKILL.md
Next.js Routing & Navigation
Requirements
Route Props Helpers (Next.js 15.5+)
- Use globally available
PageProps,LayoutProps,RouteContexttypes - no imports needed - RouteContext: Use for typing route handler context parameters with proper type inference
- PageProps: Use for page components with typed params and searchParams
- LayoutProps: Use for layout components with children and parallel route slots
- Automatically includes typed params, searchParams, children, and parallel route slots
- Always await Promise-based params and searchParams
Typed Routes (Next.js 15.5+)
- TypeScript will catch invalid routes in
<Link>components at compile time - Automatically generates types based on your file structure
- Use
Routetype for props - Use
as Routefor non-literal strings (e.g.,('/blog' + slug) as Route)