
Nextjs Data Fetching
This covers the full spectrum of Next.js App Router data fetching, from server component patterns to client libraries like SWR and React Query. You get concrete examples for parallel vs sequential fetching, ISR with time-based revalidation, on-demand cache invalidation with tags, and server actions for mutations. The guidance on when to fetch server-side versus client-side is practical, and it doesn't shy away from the tricky parts like cache poisoning with user-specific data or hydration mismatches. The real value is in the opinionated best practices, like defaulting to server components and using Promise.all for independent requests. If you're building anything beyond a basic Next.js app, you'll reference the error boundary and loading state patterns regularly.
- skills.sh installs
- 3.9K
- GitHub stars
- 369
- last updated
- Aug 21, 2026
Install
$ npx -y skills add giuseppe-trisciuoglio/developer-kit --skill nextjs-data-fetching --agent claude-codeInstalls into .claude/skills of the current project.
Files
Next.js Data Fetching
Overview
Provides patterns for data fetching in Next.js App Router: server-side fetching, SWR/React Query integration, ISR, revalidation, error boundaries, and loading states.
When to Use
- Implementing data fetching in Next.js App Router
- Choosing between Server Components and Client Components
- Setting up SWR or React Query for client-side caching
- Configuring ISR, time-based, or on-demand revalidation
- Handling loading and error states
- Building forms with Server Actions
Instructions
Server Component Fetching
Fetch directly in async Server Components:
async function getPosts() {
const res = await fetch('https://api.example.com/posts');
if (!res.ok) throw new Error('Failed to fetch posts');
return res.json();
}
export default async function PostsPage() {
const posts = await getPosts();
return (
<ul>
{posts.map((post) => (
<li key={post.id}>{post.title}</li>
))}
</ul>
);
}
Parallel Data Fetching
Use Promise.all() for independent requests:
Sponsors
Details
- Repository
- github.com/giuseppe-trisciuoglio/developer-kit
- Categories
- Frontend Development, Backend & APIs, Debugging, Automation & Workflows
- First seen
- May 16, 2026
More from giuseppe-trisciuoglio/developer-kit
All 102- Langchain4j Tool Function Calling Patterns3.9K
- Nx Monorepo3.9K
- Langchain4j Spring Boot Integration3.9K
- Langchain4j Rag Implementation Patterns3.9K
- Unit Test Scheduled Async3.9K
- Rag3.9K
- Unit Test Utility Methods3.9K
- Qdrant3.9K
- Unit Test Exception Handler3.9K
- Unit Test Mapper Converter3.9K
- Langchain4j Ai Services Patterns3.9K
- Unit Test Caching3.8K
- Unit Test Config Properties3.8K
- Unit Test Application Events3.8K
- Langchain4j Vector Stores Configuration3.8K
- Langchain4j Mcp Server Patterns3.8K
- Aws Sdk Java V2 S33.8K
- Langchain4j Testing Strategies3.8K
- Aws Sdk Java V2 Dynamodb3.8K
- Aws Rds Spring Boot Integration3.8K
- Nextjs Deployment3.8K
- Aws Sdk Java V2 Lambda3.8K
- Aws Sdk Java V2 Core3.8K
- Aws Sdk Java V2 Bedrock3.8K