React & Next.js Patterns

Implement React 19 and Next.js 15 patterns for Server Components, Client Components, and Server Actions.

Updated Sep 2, 2025
One-click install
npx skills add https://github.com/frankxai/ai-and-web3 --skill react-next-js-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: React & Next.js Patterns
Source: https://github.com/frankxai/ai-and-web3/tree/main/skills/library/claude/technical/react-nextjs-patterns
Command: npx skills add https://github.com/frankxai/ai-and-web3 --skill react-next-js-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to modern React and Next.js development patterns, enabling developers to build efficient, scalable, and maintainable applications.

Core Features & Use Cases

  • Server Components: Leverage Next.js App Router's default Server Components for data fetching and backend resource access.
  • Client Components: Understand when and how to use 'use client' for interactive elements and state management.
  • Server Actions: Implement mutations and data updates without traditional API routes.
  • Data Fetching Strategies: Utilize parallel fetching, streaming with Suspense, and caching/revalidation for optimal performance.
  • Error Handling: Implement Error Boundaries and notFound() for robust error management.
  • Performance Optimization: Employ dynamic imports, image optimization, and metadata generation.
  • FrankX-Specific Patterns: Includes examples of glassmorphic styling and loading states tailored for the FrankX stack.

Quick Start

Use the React & Next.js Patterns skill to implement a Server Action for form submissions.

Frequently Asked Questions about React & Next.js Patterns

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

FAQPage Schema
How do I use Server Actions in Next.js App Router for form mutations?

Next.js Server Actions handle form mutations by defining async functions that run on the server, eliminating traditional API routes. You can submit data directly from Client Components to Server Actions to update backend resources securely.

When should I use Server Components vs Client Components in Next.js?

Server Components are the default in the Next.js App Router for data fetching and backend access. Use 'use client' for Client Components only when you need interactivity, state management, or browser APIs like event listeners.

What's the best way to fetch data in React 19 Server Components?

The best data fetching strategy in React 19 Server Components uses parallel fetching combined with streaming via Suspense. This approach optimizes performance by allowing independent data requests to resolve without blocking the entire page load.

How do I handle errors and not found pages in Next.js App Router?

Next.js App Router error handling uses Error Boundaries to catch unexpected runtime errors and the notFound() function to manage missing resources. This ensures robust error management and graceful UI degradation during data fetching failures.

Can I use Tailwind CSS and shadcn/ui with Next.js Server Components?

Tailwind CSS and shadcn/ui integrate seamlessly with Next.js Server Components for styling. The framework enforces best practices by applying these utility-first styles directly within both Server and Client Components without hydration mismatches.

Why does my Next.js App Router page hang during sequential data fetching?

Sequential data fetching blocks rendering in the Next.js App Router. Implementing parallel fetching and wrapping components with Suspense allows streaming, which resolves hang issues by rendering available content immediately while waiting for slower requests.