But the sidebar does not appear on the page. What is the likely cause?
medium
A. The slot name sidebar does not match any route segment
B. You forgot to import React
C. The default export must be named sidebar
D. Parallel routes require class components, not functions
Solution
Step 1: Check slot name and route segment matching
Slots render only if their name matches a parallel route segment in the folder structure.
Step 2: Identify mismatch issue
If no route segment named sidebar exists, the slot won't render.
Final Answer:
The slot name sidebar does not match any route segment -> Option A
Quick Check:
Slot name must match route segment [OK]
Hint: Match slot name exactly to route segment folder [OK]
Common Mistakes:
Assuming React import is required in Next.js 13+
Thinking default export must be slot named
Believing only class components work for slots
5. You want to create a layout with parallel routes showing a nav bar and a content area side by side. Which folder structure and code setup correctly implements this using @slot?
hard
A. Folders: app/(nav)/page.tsx and app/(content)/page.tsx with export const nav = () => <nav>Nav</nav>; in nav folder and export default function Page() { return <main>Content</main>; } in content folder
B. Folders: app/(nav)/page.tsx and app/(content)/page.tsx with export default function Nav() { return <nav>Nav</nav>; } and export default function Content() { return <main>Content</main>; }
C. Folders: app/nav/page.tsx and app/content/page.tsx with export default function Nav() { return <nav>Nav</nav>; } and export default function Content() { return <main>Content</main>; }
D. Folders: app/nav/page.tsx and app/content/page.tsx with export const nav = () => <nav>Nav</nav>; in nav folder and export default function Page() { return <main>Content</main>; } in content folder
Solution
Step 1: Understand parallel route folder naming
Parallel routes use folder names without parentheses to define slots, e.g., nav and content.
Step 2: Match slot export and default export
In nav folder, export export const nav for the slot; in content folder, export default the main content.
Step 3: Verify options
Folders: app/nav/page.tsx and app/content/page.tsx with export const nav = () => <nav>Nav</nav>; in nav folder and export default function Page() { return <main>Content</main>; } in content folder correctly uses folders app/nav and app/content with proper exports.
Final Answer:
Folders: app/nav/page.tsx and app/content/page.tsx with export const nav and default export in content -> Option D
Quick Check:
Folder names match slot names without parentheses [OK]
Hint: Use folder names matching slot names without parentheses [OK]
Common Mistakes:
Using parentheses in folder names for slots
Exporting slots as default exports
Mixing slot export and default export roles
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.