0
0
NextJSframework~5 mins

Route groups with (groupName) in NextJS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a route group in Next.js App Router?
A route group is a folder in the app directory that groups routes together without affecting the URL path. It helps organize routes without changing the visible URL structure.
Click to reveal answer
beginner
How do you create a route group in Next.js using (groupName)?
You create a folder with parentheses around the group name, like (groupName), inside the app directory. This folder groups routes but does not add the groupName to the URL path.
Click to reveal answer
intermediate
Why use route groups in Next.js instead of normal folders?
Route groups help keep your file structure clean and organized without changing the URL. This is useful when you want to group related pages but keep URLs simple and user-friendly.
Click to reveal answer
beginner
Example: What URL does the route /app/(admin)/dashboard render if dashboard.js is inside (admin)?
The URL will be /app/dashboard because the (admin) folder is a route group and does not add to the URL path.
Click to reveal answer
intermediate
Can route groups contain nested route groups in Next.js?
Yes, route groups can be nested inside other route groups to organize complex route structures without affecting the URL paths.
Click to reveal answer
What does a folder named (admin) inside the app directory do in Next.js?
AAdds 'admin' to the URL path
BGroups routes without changing the URL path
CCreates a new API route
DDeletes all routes inside it
If you want to organize routes but keep URLs clean, what should you use?
ANormal folders without parentheses
BStatic files
CAPI routes
DRoute groups with (groupName)
Which of these is true about route groups in Next.js?
AThey do not affect the URL path
BThey are deprecated
CThey only work for API routes
DThey change the URL path to include the group name
How do you name a folder to make it a route group?
AUse a dot before the folder name
BPrefix the folder name with an underscore
CWrap the folder name in parentheses, like (groupName)
DAdd a dash before the folder name
Can route groups be nested inside each other?
AYes, nesting is allowed
BNo, nesting is not allowed
COnly one level of nesting is allowed
DOnly for API routes
Explain what route groups with (groupName) are in Next.js and why they are useful.
Think about how to organize routes without changing what users see in the URL.
You got /4 concepts.
    Describe how you would structure folders using route groups to keep URLs simple but organize many related pages.
    Focus on folder naming and URL impact.
    You got /4 concepts.