Q13: What are Intercepting Routes and how do they power Modal overlays?

Intercepting Routes allow loading a route inside the current layout while masking the URL path (e.g., opening a photo modal over a feed). When navigated to via client links, the intercepted route modal displays. When refreshed or accessed directly via URL, the full standalone page renders.

Photo Gallery Modal Interception
app/
├── feed/
│   ├── page.js
│   └── photo/[id]/
│       └── page.js         # Full standalone photo page (Hard Refresh)
└── @modal/
    └── (..)photo/[id]/
        └── page.js         # Intercepted photo modal overlay (Soft Click)

Clicking a photo in feed renders the photo inside @modal overlay; refreshing renders full photo page.

Key Takeaways
  • Syntax conventions: (.) matches same level, (..) matches one level up, (...) matches root app.

  • Powers soft navigation modals while keeping URLs shareable.

Knowledge Check

What happens when a user directly navigates to or hard-refreshes a shareable URL that uses an Intercepting Route?