Next.js & App Router (50 Qs)•Part 2: Core Architecture & Implementation (Mid-Level)
Intercepting Routes (`(.)`, `(..)`, `(...)`) for Shareable Modals.
senior LevelSystem Design
In Simple Words: Allows you to intercept a route from within the current layout while displaying a modal, while direct URL visits or hard refreshes display the full dedicated page:
(.)matches segments on the same level.(..)matches segments one level above.(...)matches segments from the rootappdirectory.- Example: Clicking a photo in an Instagram-like feed opens a modal (
app/feed/(..)photo/[id]), but sharing the linkmyapp.com/photo/42directly renders the full standalone photo page!