Skip to content

Route groups ()

Course: NextJS Part 3 - chapter 2

  • Parentheses allow you to create grouped routes that do not affect the URL path.
  • For example, if you have a folder named (marketing) or (auth), Next.js will not include (marketing) or (auth) in the URL—it’s just an organizational tool to group certain routes or apply layouts without changing the URL structure. Ref - https://github.com/code100x/cms/tree/main/src/app/(marketing)

Create a signup and signin page in a nextjs app where both of the pages are wrapped in a layout, but no other pages are.

The website supports three pages

  1. /signup
  2. /signin
  3. /user

💡

You cant keep all the routes at the same level. If you do, the layout will be applied to the user page as well. Hence the route groups