Performance: Layout navigation behavior
MEDIUM IMPACT
This affects page load speed and interaction responsiveness during navigation between pages sharing the same layout.
export const metadata = { title: 'Page' }; export default function Page() { return <div>Page content</div>; } // Shared layout in app/layout.tsx wraps pages, reused on navigation
export default function Page() { return <div>Page content</div>; } // No shared layout, each page reloads full HTML and CSS
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Full page reload on navigation | High (full DOM rebuild) | Multiple reflows per navigation | High paint cost due to full repaint | [X] Bad |
| Shared layout with partial page update | Low (only page subtree updated) | Single reflow for content update | Lower paint cost, mostly compositing | [OK] Good |