vercel-react-best-practices

Applies React and Next.js performance optimization rules when writing, reviewing, or refactoring code.

Updated Aug 10, 2026
One-click install
npx skills add https://github.com/Eng-suso/BK-GPT --skill vercel-react-best-practices-eng-suso
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/Eng-suso/BK-GPT/tree/main/.claude/skills/react-best-practices
Command: npx skills add https://github.com/Eng-suso/BK-GPT --skill vercel-react-best-practices-eng-suso

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? React and Next.js codebases often suffer from performance issues like data-fetching waterfalls, bloated bundles, and unnecessary re-renders that are hard to spot during development and code review. ## 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 patterns. - Incorrect vs. Correct Code Examples: Each rule includes concrete TypeScript/TSX examples showing the anti-pattern and the optimized implementation with impact metrics. - Use Case: When refactoring a Next.js page that fetches user, posts, and comments sequentially, apply the Promise.all() and Suspense boundary rules to cut load time from three round trips to one. ## Quick Start Ask the assistant 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 data fetching waterfalls in Next.js?▼

Use Promise.all() for independent async operations and start promises early in API routes before awaiting them. For partial dependencies, the better-all library maximizes parallelism by starting each task at the earliest possible moment.

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

Import directly from source files instead of barrel files, since libraries like lucide-react can re-export thousands of modules costing 200-800ms per import. In Next.js 13.5+, use the optimizePackageImports config option to transform barrel imports automatically.

When should I use React.cache() versus an LRU cache?▼

React.cache() deduplicates requests within a single server request, ideal for authentication and database queries. Use an LRU cache like lru-cache for data shared across sequential requests, such as caching user data between button clicks.

Does this guidance apply if my project uses React Compiler?▼

Some rules become unnecessary with React Compiler enabled, specifically manual memoization with memo() and useMemo(), and hoisting static JSX elements. The compiler automatically optimizes re-renders and hoists static elements for you.

Why does my conditional rendering display 0 in React?▼

Using the && operator with a numeric condition renders the falsy value 0 to the DOM. Use an explicit ternary like count > 0 ? <Badge /> : null to render nothing when the count is zero.