Vercel’s Post

Vercel reposted this

View profile for Lee Robinson, graphic

VP of Product at Vercel

Next.js Tip: Route Groups Display one layout for most of your app (like this dashboard) but eject from the layout to style other routes differently (like /login). ↳ app/layout.tsx ↳ app/login/page.tsx (ejected) ↳ app/(dashboard)/layout.tsx ↳ app/(dashboard)/page.tsx

Federico Vázquez

Sr. Software Engineer en Mercado Libre

1w

File-based routers are getting worse every day

Peyman Ghaderkourehpaz

Senior Full stack developer ( PHP, Laravel, Vue.js, Tailwindcss )

1w

Nice, do you mind to ask if you can share the git repository? if it’s not a private repository

Like
Reply
Thorsten Schaeff

DX Engineer at Supabase

1w

Yoo Lee Robinson I like that format! What do you use for recording / editing and what resolution do you export at?

Like
Reply
Milkias Bekele

Full stack developer, Web And Mobile App Designer | Developer, 3d Artist | Front end Developer | Backend Developer, Next Js, React Js, Node Js, Shopify, Creative Developer

6d

I actually prefer this method of grouping routes over the previous approach of having my route go through the dashboard to reach the main page, which was challenging to manage since version 12. Ever since the release of Next.js 13, I have come to appreciate and now rely on this improved routing structure since i can have multiple files under the groups and add components for each as well. File based routers are getting easy to manage once you understand how to structure your projects.

Federico P.

Create tech products that solve business problems | Co-Founder at Spinlab | Part-Time Tennis Player

1w

Amazing explanation! Also, in this case /dashboard won't be added to the url so it's always a good idea to use the (routeGroups) mostly as organizational and not so much to eject things as it could be misleading.

Like
Reply

Well said Lee! this is how tutorials should teach a concepts (straight to the point only focusing on the topic)

Like
Reply

This feature is fantastic

Like
Reply
Zayne Lovecraft

Software Engineer 2 at McDonald's

6d

Personally I love this feature

Like
Reply
Ravindra Sirvi

Next JS | Angular Developer | ASP.NET Core Expertise, Business Risk Management, Code Quality Assurance

1w

Useful tips, thanks for sharing

See more comments

To view or add a comment, sign in

Explore topics