Skip to content
Back to skills

Handling Dynamic Routing

ASecurity

Logic for Next.js 15 Dynamic Routes. Use when building pages like `tours/[id]`.

  • 666 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added February 9, 2026
developmenttypescriptnextjs

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill handling-dynamic-routing --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Handling Dynamic Routing?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Handling Dynamic Routing
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-handling-dynamic-routing/badge)](https://www.skillsdirectory.com/skills/majiayu000-handling-dynamic-routing)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: handling-dynamic-routing
description: Logic for Next.js 15 Dynamic Routes. Use when building pages like `tours/[id]`.
---

# Dynamic Routing Patterns

## When to use this skill
- Creating pages that depend on a parameter (slug, ID).
- Handling `params` in Next.js 15 Server Components.

## Workflow (Next.js 15)
- [ ] Define the folder: `app/tours/[id]/page.tsx`.
- [ ] Access `params` as a **Promise** (required in v15).
- [ ] Fetch data based on the resolved `id`.

## Implementation
```typescript
interface TourPageProps {
    params: Promise<{ id: string }>;
}

export default async function TourDetailsPage({ params }: TourPageProps) {
    const { id } = await params; // Await the promise
    const tour = await TourService.getById(id);
    
    return (
        <main>
            <h1>{tour.title}</h1>
            {/* ... */}
        </main>
    );
}
```

## Instructions
- **Metadata**: Await `params` in `generateMetadata` as well.
- **Loading**: Use `loading.tsx` in the directory for automatic fallback UI.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.