Default slot fallback
What you need to know
A default.tsx file defines the fallback for a parallel slot whose active subpage cannot be recovered during a full document load. This matters because the browser URL alone may not describe every panel that was active before refresh. In the Next.js 16 lane, explicit default files are required for named slots.
By the end, you can: predict direct-load behavior; provide a fallback for unmatched slots.
Workspace with a detail route
app/workspace/ layout.tsx page.tsx default.tsx history/page.tsx @activity/ page.tsx default.tsxExpected behavior (not framework-tested): A soft transition from /workspace to /workspace/history can retain the activity slot. A direct load of /workspace/history cannot recover that old active state and uses the slot default.
How it works
Treat default as a hard-load fallback, not a universal reset-on-navigation component. Provide a sensible empty state, a stable summary, or a not-found outcome when an unmatched slot makes no sense. Include a default for the implicit children slot if it can be unmatched; this fixture supplies one explicitly. Older tutorials may describe a missing default as a runtime 404, whereas the 16 upgrade guide requires explicit named-slot defaults and documents a build error for omission.
app/workspace/@activity/default.tsx
export default function ActivityDefault() { return <p>No activity panel selected.</p>;}// An optional modal slot could instead return null.Expected behavior (not framework-tested): A direct load of history can display a meaningful empty panel rather than relying on prior navigation state.
Common mistake
Do not assume a refresh reproduces the same slot selection as a soft transition. Also do not expect default.tsx alone to close an active modal on every link: explicitly match the destination with an empty slot page when necessary.
Practice and verification
Create a matrix for direct /workspace, soft navigation to /workspace/history, refresh on history and return home. Record the expected children and activity UI for each, then test in a real browser when available.
Scope: App Router, proposed Next.js 16.x, Cache Components disabled for these labs. Snippets assume a reviewed TypeScript app and are static examples; framework behavior has not been executed. Exact supported patch and dependency set must be verified before running.