Challenge - 5 Problems
Route Group Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ component_behavior
intermediate2:00remaining
What is the rendered output of this Next.js route group?
Consider a Next.js app router with this folder structure:
The (admin) folder is a route group. What URL path will render the dashboard page?
app/(admin)/dashboard/page.tsxThe (admin) folder is a route group. What URL path will render the dashboard page?
NextJS
app/(admin)/dashboard/page.tsx export default function Dashboard() { return <h1>Admin Dashboard</h1>; }
Attempts:
2 left
💡 Hint
Route groups group routes without adding to the URL path.
✗ Incorrect
Route groups in Next.js app router let you organize routes without affecting the URL. So the (admin) folder does not add 'admin' to the URL path. The dashboard page is at '/dashboard'.
📝 Syntax
intermediate1:30remaining
Which folder name correctly creates a route group in Next.js?
You want to create a route group named 'marketing' in your Next.js app router. Which folder name is valid?
Attempts:
2 left
💡 Hint
Route groups use parentheses in folder names.
✗ Incorrect
Next.js route groups are created by wrapping the folder name in parentheses, like (marketing).
🔧 Debug
advanced2:30remaining
Why does this route group cause a 404 error?
You have this folder structure:
But navigating to '/profile' shows a 404 error. What is the likely cause?
app/(user)/profile/page.tsxBut navigating to '/profile' shows a 404 error. What is the likely cause?
NextJS
app/(user)/profile/page.tsx export default function Profile() { return <p>User Profile</p>; }
Attempts:
2 left
💡 Hint
Next.js app router requires layouts to render nested pages.
✗ Incorrect
In Next.js app router, the app folder needs a root layout.tsx file. Without it, nested routes like (user)/profile/page.tsx won't render and cause 404.
🧠 Conceptual
advanced1:30remaining
What is the main benefit of using route groups in Next.js?
Why would a developer use route groups (folders with parentheses) in a Next.js app router project?
Attempts:
2 left
💡 Hint
Think about URL paths and folder structure.
✗ Incorrect
Route groups let you group files and folders for better organization without adding extra segments to the URL path.
❓ state_output
expert3:00remaining
What is the URL path and rendered output for nested route groups?
Given this folder structure:
And the page.tsx contains:
What URL path shows this page and what is the rendered output?
app/(dashboard)/(settings)/profile/page.tsxAnd the page.tsx contains:
export default function Profile() { return <h2>Profile Settings</h2>; }What URL path shows this page and what is the rendered output?
NextJS
app/(dashboard)/(settings)/profile/page.tsx export default function Profile() { return <h2>Profile Settings</h2>; }
Attempts:
2 left
💡 Hint
Route groups do not add to the URL path.
✗ Incorrect
Nested route groups do not add segments to the URL. So the URL is '/profile'. The page renders an h2 heading with 'Profile Settings'.