Next.js Loading UI and Suspense — Streaming and Skeleton Screens
Use Next.js loading.tsx and React Suspense to stream content progressively, show skeleton screens instantly, and improve perceived performance for data-heavy pages.
1582 articles
Use Next.js loading.tsx and React Suspense to stream content progressively, show skeleton screens instantly, and improve perceived performance for data-heavy pages.
Handle errors gracefully in Next.js with error.tsx boundaries, not-found.tsx custom 404 pages, global error handling, and error recovery with the reset function.
Master the Next.js nested layout system — build persistent sidebars, per-section navigation, and shared UI that survives navigation without re-mounting using layout.tsx and template.tsx.
Use Next.js route groups with parentheses notation to organize related pages, apply different layouts to URL segments, and co-locate files without changing your URL structure.
Build REST API endpoints in Next.js using App Router Route Handlers — handling GET, POST, PUT, DELETE with typed requests, middleware, and streaming responses.