The Complete Guide to Next.js 16 App Router
What Changed in Next.js 16
Next.js 16 brings significant improvements to the App Router, making it the definitive way to build React applications. The key changes include improved streaming, better error handling, and new route patterns.
Layouts: The Foundation
Layouts are the building blocks of your application's UI architecture. They persist across navigations and maintain state:
export default function DashboardLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<div className="flex min-h-screen">
<Sidebar />
<main className="flex-1 p-6">{children}</main>
</div>
)
}Warning
Layouts do not re-render on navigation. If you need fresh data on every navigation, use a page component instead.
Loading States
The loading.tsx convention gives you instant loading UI:
export default function Loading() {
return <DashboardSkeleton />
}Route Groups
Organize routes without affecting URLs using parenthesized folders:
app/
├── (marketing)/
│ ├── about/page.tsx → /about
│ └── blog/page.tsx → /blog
├── (app)/
│ ├── dashboard/page.tsx → /dashboard
│ └── settings/page.tsx → /settingsServer Components by Default
Every component in the App Router is a Server Component unless you opt in with "use client". This means:
- Zero JavaScript shipped to the client by default
- Direct database access in components
- Smaller bundle sizes
Parallel Routes
Render multiple pages simultaneously in the same layout:
app/
├── @analytics/page.tsx
├── @team/page.tsx
└── layout.tsxThis is incredibly powerful for dashboards where independent sections load at different speeds.
admin
Senior frontend engineer and tech writer. Passionate about React, TypeScript, and building great developer experiences. Previously at Vercel and Stripe.
Comments (2)
Great overview! One question — how do you handle authentication in the App Router? I've been struggling with middleware vs layout-level auth checks.
The parallel routes section was incredibly helpful. We just implemented this pattern in our dashboard and it improved perceived load time significantly.
Related Posts
Building a Design System with Tailwind CSS v4 and React
Learn how to create a scalable, token-based design system using Tailwind CSS v4's new CSS-first configuration and React component patterns.
Mastering TypeScript Generics: Real-World Patterns
Move beyond basic generics with practical patterns for type-safe APIs, component props, and utility types that you'll use every day.
Optimizing React Performance: From 3s to 300ms
Real performance wins from a production React app — covering code splitting, memo strategies, virtualization, and the new React compiler.