Performance: Programmatic navigation (useRouter)
MEDIUM IMPACT
This affects page load speed and interaction responsiveness by controlling client-side navigation without full page reloads.
import { useRouter } from 'next/router'; const router = useRouter(); router.push('/about');
window.location.href = '/about';
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| window.location.href navigation | Full DOM reload | Multiple reflows | High paint cost | [X] Bad |
| useRouter.push navigation | Partial DOM update | Minimal reflows | Low paint cost | [OK] Good |