Next.js & App Router (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)
How does Client-Side Navigation work in Next.js (`<Link>`, `useRouter`, `redirect`)?
junior LevelCLIRouting
In Simple Words:
<Link href="/dashboard">:- Performs soft client-side navigation without full-page browser reloads.
- Automatically prefetches linked route data and RSC payloads in the background when the link enters the user's viewport!
useRouter(): Programmatic navigation in Client Components (router.push('/dashboard')).redirect('/login'): Server-side redirect used inside Server Components, Server Actions, or Route Handlers. (Throws an internal Next.js redirect exception).