Skip to main content

Next.js Server vs. Client Components

Skill Verified
98

Guide for choosing between Server Components and Client Components in Next.js App Router. CRITICAL for useSearchParams (requires Suspense + 'use client'), navigation (Link, redirect, useRouter), cookies/headers access, and 'use client' directive. Activates when prompt mentions useSearchParams, Suspense, navigation, routing, Link component, redirect, pathname, searchParams, cookies, headers, async components, or 'use client'. Essential for avoiding mixing server/client APIs.

AI Summary

This skill provides detailed explanations and code examples for differentiating between Next.js Server and Client Components. It covers critical patterns like data fetching, hook usage, navigation, and the React 'use' API, along with common anti-patterns to avoid.

Installation

npx skills add wsimmonds/claude-nextjs-skills

Runs the Vercel skills CLI (skills.sh) via npx — needs Node.js locally and at least one installed skills-compatible agent (Claude Code, Cursor, Codex, …). Assumes the repo follows the agentskills.io format.

7 months ago
90 stars
MIT
Updated 3 days ago
View Source

© 2025 SkillRepo · Find the right skill, skip the noise.