Performance: Link component for client navigation
MEDIUM IMPACT
This affects page load speed and interaction responsiveness by enabling client-side navigation without full page reloads.
import Link from 'next/link'; export default function Nav() { return <Link href="/about">About</Link>; }
import React from 'react'; export default function Nav() { return <a href="/about">About</a>; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Plain <a> tag navigation | Full DOM reload | Multiple reflows due to full page reload | High paint cost from re-rendering entire page | [X] Bad |
| Next.js Link component | Partial DOM update | Single reflow for updated components | Lower paint cost by reusing DOM | [OK] Good |