App Router & RSC · 9 min read · Intermediate
App Router, Layouts & File Conventions
Master Next.js App Router folder-based routing, shared nested layouts, and persistent navigation shells.
What you'll learn
- Map folder segments under app/ directly to URL routes
- Share persistent UI with layout.tsx without remounting on navigation
- Use route groups like (marketing) to organize folders without changing URLs
Overview
Master Next.js App Router folder-based routing, shared nested layouts, and persistent navigation shells.
Next.js App Router unifies server rendering, streaming, type-safe mutations, and edge-ready caching inside a single React + TypeScript codebase.
Production Code Example
// app/dashboard/layout.tsx
export default function DashboardLayout({ children }: { children: React.ReactNode }) {
return (
<div className="grid grid-cols-[240px_1fr] min-h-screen">
<aside className="border-r p-4">Sidebar Nav</aside>
<main className="p-6">{children}</main>
</div>
);
}
Key Takeaways
- Map folder segments under app/ directly to URL routes
- Share persistent UI with layout.tsx without remounting on navigation
- Use route groups like (marketing) to organize folders without changing URLs
Quick Check
Check Your Understanding
Score: 0 / 1
1. What happens to a parent `layout.tsx` when navigating between two sibling child pages in Next.js App Router?
Study Workspace
Finished this lesson?
Your progress is saved locally in your browser, no account needed.