react-nextjs

Guide React and Next.js app building with App Router and Zustand.

6|Updated Apr 7, 2026
One-click install
npx skills add https://github.com/Kgan01/ghengis-skills --skill react-nextjs-kgan01
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-nextjs
Source: https://github.com/Kgan01/ghengis-skills/tree/main/plugins/ghengis-skills/skills/react-nextjs
Command: npx skills add https://github.com/Kgan01/ghengis-skills --skill react-nextjs-kgan01

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides structured guidance for building and maintaining React or Next.js projects, clarifying architecture choices (App Router, server vs client components), data fetching patterns, and common pitfalls to avoid.

Core Features & Use Cases

  • Server Components by default to minimize client JS, with explicit 'use client' when needed.
  • Data fetching strategies across server and client components (fetching, caching, and prop drilling considerations).
  • State management with Zustand and patterns for sharing UI state across routes.
  • Practical patterns for routing, layout, and component composition in Next.js 15 App Router.

Quick Start

Describe a minimal Next.js app using App Router with a server component page and a client component, including a data fetch pattern and a dynamic import.

Frequently Asked Questions about react-nextjs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure server and client components in Next.js App Router?

Next.js App Router defaults to server components to minimize client JS. You must explicitly add the 'use client' directive to establish client boundaries for interactive UI elements, ensuring safe data flow patterns across your application architecture.

What is the best way to manage shared UI state across routes with Zustand?

Zustand manages shared UI state across routes by creating a global store accessible from client components. This approach avoids excessive prop drilling and maintains consistent state synchronization throughout your Next.js application component tree.

How do I handle data fetching and caching in Next.js server components?

Data fetching in Next.js server components leverages the App Router's built-in caching mechanisms. You fetch data directly within server components and pass it as props to client components, establishing safe data flow patterns without over-fetching on the client.

When should I use dynamic imports for large libraries in a Next.js application?

Dynamic imports for large libraries in Next.js reduce initial client-side JavaScript bundles. You should dynamically import heavy client-side dependencies only when needed within explicit client boundaries to optimize application loading performance.

Why does my Next.js server component throw an error when trying to use Zustand?

Zustand requires client-side rendering and fails in Next.js server components by default. You must encapsulate Zustand state management within explicit client boundaries marked by the 'use client' directive to avoid common server-side execution pitfalls.