
Nextjs Server Navigation
Handles the difference between server and client navigation in Next.js so you stop reflexively adding 'use client' just to use Link components. Covers Link for static routes, redirect() for conditional server-side routing, and server actions for form-based navigation. The key insight is that Link works perfectly fine in async server components, and redirect() lets you bail out based on auth checks or data without touching client hooks. If you've been converting server components to client components just to add navigation, or you're unclear when to use useRouter() versus redirect(), this clarifies the boundaries. Includes comparison tables and TypeScript examples throughout.
- skills.sh installs
- 305
- GitHub stars
- 110
- last updated
- Aug 21, 2026
Install
$ npx -y skills add wsimmonds/claude-nextjs-skills --skill nextjs-server-navigation --agent claude-codeInstalls into .claude/skills of the current project.
Files
Next.js: Server Component Navigation Pattern
⚠️ CRITICAL RULE
Server Components use DIFFERENT navigation methods than Client Components!
When requirements call for server-rendered navigation—for example, linking to other pages, redirecting after a check, or demonstrating routing patterns—prefer <Link> and redirect() within Server Components. You still avoid 'use client' unless a client-only API is involved.
The Pattern
Scenario: build a server component that demonstrates proper navigation patterns
✅ CORRECT Solution:
// app/page.tsx (Server Component - NO 'use client'!)
import Link from 'next/link';
export default async function Page() {
return (
<div>
<h1>Home</h1>
<Link href="/dashboard">Go to Dashboard</Link>
<Link href="/profile">View Profile</Link>
</div>
);
}
❌ WRONG Solution:
// app/page.tsx
'use client'; // ❌ NO! Server components don't need this for navigation!
import { useRouter } from 'next/navigation'; // ❌ Wrong for server components
export default function Page() {
const router = useRouter(); // ❌ This is client-side navigation
// ...
}
Sponsors
Details
- Repository
- github.com/wsimmonds/claude-nextjs-skills
- Categories
- Frontend Development, Backend & APIs, Documentation
- First seen
- Jun 3, 2026