ข้ามไปยังเนื้อหาหลัก
เนื้อหานี้ยังไม่มีในภาษาของคุณ และกำลังแสดงเป็นภาษาอังกฤษ

Next.js Server vs. Client Components

Skill ยืนยันแล้ว
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

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.

การติดตั้ง

npx skills add wsimmonds/claude-nextjs-skills

เรียกใช้ Vercel skills CLI (skills.sh) ผ่าน npx — ต้องติดตั้ง Node.js ในเครื่อง และมี agent ที่รองรับ skills อย่างน้อยหนึ่งตัว (Claude Code, Cursor, Codex, …) ทั้งนี้สมมติว่า repo ใช้รูปแบบ agentskills.io

7 months ago
90 stars
MIT
อัปเดตเมื่อ 2 days ago
ดูซอร์สโค้ด