Đi tới nội dung chính
Nội dung này hiện chưa có sẵn bằng ngôn ngữ của bạn và đang được hiển thị bằng tiếng Anh.

Next.js Server vs. Client Components

Skill Đã xác minh
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.

Tóm tắt từ AI

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.

Cài đặt

npx skills add wsimmonds/claude-nextjs-skills

Chạy Vercel skills CLI (skills.sh) qua npx — yêu cầu Node.js trên máy và ít nhất một agent tương thích skills đã được cài (Claude Code, Cursor, Codex, …). Giả định repo tuân theo định dạng agentskills.io.

7 months ago
90 stars
MIT
Cập nhật 2 days ago
Xem mã nguồn