vercel-react-best-practices

Applies React and Next.js performance optimization rules during code writing and review.

Updated Oct 2, 2025
One-click install
npx skills add https://github.com/YuriiYInno/Innogram --skill vercel-react-best-practices-yuriiyinno
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/YuriiYInno/Innogram/tree/main/.codex/skills/react-best-practices
Command: npx skills add https://github.com/YuriiYInno/Innogram --skill vercel-react-best-practices-yuriiyinno

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? React and Next.js codebases often suffer from request waterfalls, bloated bundles, redundant re-renders, and inefficient data fetching that degrade load times and interactivity. This Skill provides a structured, impact-prioritized rule set so AI agents and developers consistently apply proven performance patterns when writing, reviewing, or refactoring code. ## Core Features & Use Cases - 45 Prioritized Rules Across 8 Categories: Covers eliminating waterfalls, bundle size optimization, server-side performance, client-side data fetching, re-render optimization, rendering performance, JavaScript micro-optimizations, and advanced ref patterns. - Incorrect vs. Correct Examples: Each rule includes concrete TypeScript/TSX code comparisons with impact metrics (e.g., 2-10x improvement from parallelizing fetches, 200-800ms savings from avoiding barrel imports). - Use Case: When refactoring a Next.js page that sequentially awaits user, posts, and comments, the Skill directs you to use Promise.all() or better-all, cutting three network round trips down to one. ## Quick Start Ask the AI to review your React component or Next.js page for performance issues using the Vercel React best practices guidelines.

Frequently Asked Questions about vercel-react-best-practices

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

FAQPage Schema
How do I eliminate request waterfalls in Next.js?▼

Start independent async operations immediately and await them together with Promise.all, or use better-all for partial dependency chains. In API routes, kick off auth and config fetches before awaiting either, cutting sequential round trips from three to one.

How to reduce React bundle size from barrel file imports?▼

Import directly from source files instead of barrel entry points, such as lucide-react/dist/esm/icons/check instead of the package root. In Next.js 13.5+, configure experimental.optimizePackageImports to transform barrel imports automatically at build time.

When should I use React.cache versus SWR for deduplication?▼

React.cache deduplicates server-side work like database queries and auth checks within a single request, while SWR deduplicates client-side fetches across component instances. Next.js already memoizes fetch calls, so reserve React.cache for non-fetch async work.

Does this guide work with React Server Components?▼

Yes, several rules target RSC specifically, including minimizing serialization at server-client boundaries, parallel data fetching through component composition, and using after() for non-blocking operations. The patterns assume the Next.js App Router architecture.

When should I not use Suspense boundaries for data fetching?▼

Avoid Suspense when data drives layout decisions, when content is SEO-critical above the fold, or when queries are fast enough that suspense overhead is not worthwhile. The trade-off is faster initial paint versus potential layout shift.