Next.js App Router Multiple Root Layouts: Explained With Examples

preview_player
Показать описание


Let's GO 🚀

I take special care to provide you the best quality. Please SUBSCRIBE to the channel to show your support. Also, could you like/comment on this video so that it reaches others? Thanks! 🫶

Timecodes
0:00 - Understand the problem, first
02:02 - The usual Layout and Pages
05:05 - First attempt to hide header and footer
07:59 - Exposing the wrong way
09:00 - The solution: Route Grouping
12:56 - Let's see things working!
13:06 - A quick recap
14:12 - The end note

## The Source Code Used In The video:

## Join tapaScript Discord

## 🤝 My Links:

## Special Links:

## 👋 Like my work? Thank You. You can sponsor me from here:

## About Me:
Tapas Adhikary is an Educator at tapaScript, Tech enthusiast, Writer, YouTuber, and Open Source projects maintainer/contributor. He is a full-stack developer who has vast experience in building SaaS solutions. He is the founder of the ReactPlay platform, which is driven by open-source projects and a fast-growing community.

#nextjstutorial
#next
#nextjs14
#nextjs
Рекомендации по теме
Комментарии
Автор

Absolutely awesome! You started by describing the exact mistake I was making while trying to create a different layout for my dashboard, and then you provided a wonderful solution that works like a charm. I can't thank you enough for this tutorial.

kenkioqqo
Автор

I was racking my brains over this, thanks a lot for the clear explanation, really helpful

klebergermano
Автор

Thanks for the clarity... Been facing this route problem since yesterday and almost gave up but your video has saved me.

thebenkalungi
Автор

you are life saver sir. awesome video for those who dont want to read the docs.

ZeynalZeynalli-yonl
Автор

Great explanation on Next.js route grouping! Astro.js has a very similar approach, and it's really helpful to see how both frameworks handle this. This video was super helpful in deepening my understanding—thanks for sharing!

AlexanderWilson-htdt
Автор

Thank you so much for sharing your knowledge!

AngelaCui-fntn
Автор

Great video! Your explanation of multiple layouts in Next.js was clear and practical. The examples were easy to follow and very helpful.

prateekshawebdesign
Автор

Thanks Tapas da...you always shows all the edge cases...you're an awesome teacher❤

metadope
Автор

FINALLY I FOUND THE VIDEO TO SOLVE MY PROBLEM, TY TAPAS. THE EXPLANATION COULDNT BE ANY BETTER

mateomohr
Автор

Your every video is going outstanding many different things but I think just for a recap of the last moment. 💕💕

snow-script
Автор

Ur way of explaining the concept is awesome sir ❤❤❤

jahangirkhan
Автор

The way you explained is very insane and informative. Sooo much informative content. ♥

wasiuddinmansoori
Автор

straightforward video, does the thing i wanted to know. thanks!

froilanimnida
Автор

AMAZING! PERFECT! THANKS A LOT FROM THE BOTTOM OF MY HEART!

ederross
Автор

saved my day!
thanks for the explaination

MailsonVarela-onwe
Автор

you just got a new subscriber sir.. you are a genius

emmanuelsalami
Автор

Hot reloading is only working for the (home) group and not for other groups. Additionally, I have react-hook-form implemented in other groups, and the same issue occurs: it's only working in the (home) group and not in other groups.

ruvkwlj
Автор

Hi there! ChatGPT tells me that it is not required to put html and body tags into RootLayout, cause since Next.js13 it is automatically. But I cannot see this in next doc. Any ideas?)

ilyahuman
Автор

My trouble is not knowing how to achieve route grouping but with dynamic slugs ( [...slug] ), because obviously this confuses the system. I've tried everything but still can't figure out how to get the Root Layout to distinguish between header/noheader based on CMS data. I can do it by putting headers inside sub-layouts instead (as sub layouts can receive the slug array) but that unfortunately re-renders the header every time the route changes (problematic for preserving header state). I don't actually think there is a clean solution to this beyond designating a hardcoded no-header sub route. Anyway... easy enough for me to manually make per-project specific folders in src/app to manage this, but I was dreaming up a pure CMS driven solution :(.

MrTingle-qine
Автор

This solved my problem but there is 1 more issue occured. How do you make a not-found page for this multiple root layouts? Even if I put not-found.tsx file in both (auth) and (home) folder, when go to wrong url, the browser render not found page from default nextJS itself not from my not-found.tsx file.

DuK-