← スキル一覧に戻る

nextjs-pathname-id-fetch
by kensleDev
⭐ 0🍴 0📅 2026年1月16日
SKILL.md
name: nextjs-pathname-id-fetch
IMPORTANT: Keep description on ONE line for Claude Code compatibility
prettier-ignore
description: Fetch data using URL parameter. Create app/[id]/page.tsx, await params to get ID, fetch API, render. Server Component (no 'use client'). allowed-tools: Read, Write, Edit, Glob, Grep, Bash
Next.js: Pathname ID Fetch Pattern
Quick Start
Dynamic route folder: app/[id]/page.tsx → URL segment accessible as params
// app/[id]/page.tsx
export default async function ProductPage({
params,
}: {
params: Promise<{ id: string }>;
}) {
const { id } = await params; // Next.js 15+: await params
const product = await fetch(`https://api.example.com/products/${id}`)
.then(r => r.json());
return <div><h1>{product.name}</h1></div>;
}
Reference Files
- pattern.md - Full implementation, parameter names, multiple parameters
Notes
- Server Component (default): No 'use client' needed
- Keep structure simple: Use
app/[id]/unless explicitly told otherwise - Last verified: 2025-01-11
スコア
総合スコア
40/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です