0

Linking & navigation

Routingused in ~95% of apps

Almost every tutorial gets this half-wrong: they treat `<Link>` like a fancy `<a>`, or reach for the router on every click. Knowing exactly when navigation should be declarative (`<Link>`) versus imperative (`useRouter`) — and what Next.js 16 prefetches behind your back — is the difference between an app that feels instant and one that flashes a white page on every click.

Core idea. Use `<Link href>` for navigation the user initiates by clicking a known destination: it does client-side navigation (no full reload) and prefetches the route ahead of time. Use `useRouter()` from `next/navigation` only for programmatic navigation from code — after a form submit, a successful mutation, or a timeout — where there is no link to click.
Playground, this isn't a screenshot
app.pulse.dev/login
Login screen
the URL drives which component shows — no full reload
navigation mode for the buttons below
Submit the login form, then redirect to the app:
history stack1 entry
0/login here

Push grows the stack; replace overwrites the top; Back/Forward just move the pointer.

Submit the login form, then navigate around. Watch the URL and the history stack.
↑ play a little first, then dig in