Skip to content
Skills Library
Programming · Review & audit

react-best-practices

/react-best-practices

React and Next.js performance rules from Vercel Engineering, ranked by impact, with local overrides for React Compiler and Next.js 16 caching. Use when writing or refactoring React components, reviewing a React or Next.js codebase for performance, fixing async data-fetching waterfalls, shrinking a JavaScript bundle, hunting wasteful re-renders, choosing a Next.js server caching pattern, or fixing a hydration mismatch. Do NOT use for Vue, Svelte, Solid or Angular code - follow that framework's docs; React Native - use React Native docs; browser or end-to-end testing of a web app - use Anthropic

Licence
MIT
Last repository change
04.10.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
75
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 04.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

React and Next.js performance rules from Vercel Engineering, ranked by impact, with local overrides for React Compiler and Next.js 16 caching. Use when writing or refactoring React components, reviewing a React or Next.js codebase for performance, fixing async data-fetching waterfalls, shrinking a JavaScript bundle, hunting wasteful re-renders, choosing a Next.js server caching pattern, or fixing a hydration mismatch. Do NOT use for Vue, Svelte, Solid or Angular code - follow that framework's docs; React Native - use React Native docs; browser or end-to-end testing of a web app - use Anthropic

Original author description

React and Next.js performance rules from Vercel Engineering, ranked by impact, with local overrides for React Compiler and Next.js 16 caching. Use when writing or refactoring React components, reviewing a React or Next.js codebase for performance, fixing async data-fetching waterfalls, shrinking a JavaScript bundle, hunting wasteful re-renders, choosing a Next.js server caching pattern, or fixing a hydration mismatch. Do NOT use for Vue, Svelte, Solid or Angular code - follow that framework's docs; React Native - use React Native docs; browser or end-to-end testing of a web app - use Anthropic

How it works

  1. Steps
  2. Rule index
Original SKILL.md headings · 146 lines, 1,041 words
SKILL.md preview
---
name: react-best-practices
description: React and Next.js performance rules from Vercel Engineering, ranked by impact, with local overrides for React Compiler and Next.js 16 caching. Use when writing or refactoring React components, reviewing a React or Next.js codebase for performance, fixing async data-fetching waterfalls, shrinking a JavaScript bundle, hunting wasteful re-renders, choosing a Next.js server caching pattern, or fixing a hydration mismatch. Do NOT use for Vue, Svelte, Solid or Angular code - follow that framework's docs; React Native - use React Native docs; browser or end-to-end testing of a web app - use Anthropic's webapp-testing skill; Shopify themes - use shopify-developer.
license: MIT
paths:
  - "**/*.tsx"
  - "**/*.jsx"
  - "**/next.config.*"
---

# React best practices

Vercel's React and Next.js performance rules, one file per rule in `rules/`, ranked by impact.
`local-notes.md` holds local overrides that win over any rule they contradict.

## Steps

### 1. Read the stack

Check `package.json` and `next.config.*` for:

- the `react` and `next` versions in use
- React Compiler: `reactCompiler` in `next.config.*`, or `babel-plugin-react-compiler` in a build config
- Next.js Cache Components: `cacheComponents: true` in `next.config.*`

When React Compiler is on, or the project uses Next.js, read [local-notes.md](local-notes.md) before
step 2 - it says which memoisation rules the compiler makes redundant and how Next.js 16 caching
changes the `server-` and `async-` rules.

Done when you can state the React version, whether Next.js is present, and whether React Compiler and
Cache Components are each on or off.

### 2. Read the rules for the categories in play

Pick the categories the task touches from the index below. For a review or audit, take all eight in
priority order. Open `rules/<rule-id>.md` for each rule you apply or check - the index line is a
summary, and the file carries the incorrect and correct code and the conditions for applying it.

Done when every rule file in the chosen categories has been read.

### 3. Apply or report

When writing code, apply the rules as you go. When reviewing, report each finding as: rule id, file and
line, impact level, and the fix. Work from CRITICAL down, so waterfalls and bundle size come before
re-render and micro-optimisations.

Done when every finding names a rule id, and every chosen category has been checked against the code.

## Rule index

| Priority | Category | Impact | Prefix |
|----------|----------|--------|--------|
| 1 | Eliminating waterfalls | CRITICAL | `async-` |
| 2 | Bundle size | CRITICAL | `bundle-` |
| 3 | Server-side performance | HIGH | `server-` |
| 4 | Client-side data fetching | MEDIUM-HIGH | `client-` |
| 5 | Re-render optimisation | MEDIUM | `rerender-` |
| 6 | Rendering performance | MEDIUM | `rendering-` |
| 7 | JavaScript performance | LOW-MEDIUM | `js-` |
| 8 | Advanced patterns | LOW | `advanced-` |

### 1. Eliminating waterfalls (CRITICAL)

- `async-cheap-condition-before-await` - Check cheap sync conditions before awaiting flags or remote values
- `async-defer-await` - Move await into branches where actually used
- `async-parallel` - Use Promise.all() for independent operations
- `async-dependencies` - Use better-all for partial dependencies
- `async-api-routes` - Start promises early, await late in API routes
- `async-suspense-boundaries` - Use Suspense to stream content

### 2. Bundle size (CRITICAL)

- `bundle-barrel-imports` - Import directly, avoid barrel files
- `bundle-analyzable-paths` - Prefer statically analysable import and file-system paths
- `bundle-dynamic-imports` - Use next/dynamic for heavy components
- `bundle-defer-third-party` - Load analytics and logging after hydration
- `bundle-conditional` - Load modules only when the feature is activated
- `bundle-preload` - Preload on hover or focus for perceived speed

### 3. Server-side performance (HIGH)

- `server-auth-actions` - Authenticate server actions like API routes
- `server-cache-react` - Use React.cache() for per-request deduplication
- `server-cache-lru` - Use an LRU cache for cross-request caching
- `server-dedup-props` - Avoid duplicate serialisation in RSC props
- `server-hoist-static-io` - Hoist static I/O (fonts, logos) to module level
- `server-no-shared-module-state` - Avoid module-level mutable request state in RSC/SSR
- `server-serialization` - Minimise data passed to client components
- `server-parallel-fetching` - Restructure components to parallelise fetches
- `server-parallel-nested-fetching` - Chain nested fetches per item in Promise.all
- `server-after-nonblocking` - Use after() for non-blocking operations

### 4. Client-side data fetching (MEDIUM-HIGH)

- `client-swr-dedup` - Use SWR for automatic request deduplication
- `client-event-listeners` - Deduplicate global event listeners
- `client-passive-event-listeners` - Use passive listeners for scroll
- `client-localstorage-schema` - Version and minimise localStorage data

### 5. Re-render optimisation (MEDIUM)

- `rerender-defer-reads` - Skip subscribing to state used only in callbacks
- `rerender-memo` - Extract expensive work into memoised components
- `rerender-memo-with-default-value` - Hoist default non-primitive props
- `rerender-dependencies` - Use primitive dependencies in effects
- `rerender-derived-state` - Subscribe to derived booleans, not raw values
- `rerender-derived-state-no-effect` - Derive state during render, not in effects
- `rerender-functional-setstate` - Use functional setState for stable callbacks
- `rerender-lazy-state-init` - Pass a function to useState for expensive values
- `rerender-simple-expression-in-memo` - Leave simple primitive expressions out of useMemo
- `rerender-split-combined-hooks` - Split hooks with independent dependencies
- `rerender-move-effect-to-event` - Put interaction logic in event handlers
- `rerender-transitions` - Use startTransition for non-urgent updates
- `rerender-use-deferred-value` - Defer expensive renders to keep input responsive
- `rerender-use-ref-transient-values` - Use refs for transient, frequently changing values
- `rerender-no-inline-components` - Define components at module level, not inside other components

### 6. Rendering performance (MEDIUM)

- `rendering-animate-svg-wrapper` - Animate a div wrapper, not the SVG element
- `rendering-content-visibility` - Use content-visibility for long lists
- `rendering-hoist-jsx` - Extract static JSX outside components
- `rendering-svg-precision` - Reduce SVG coordinate precision
- `rendering-hydration-no-flicker` - Use an inline script for client-only data
- `rendering-hydration-suppress-warning` - Suppress expected mismatches
- `rendering-activity` - Use the Activity component for show/hide
- `rendering-conditional-render` - Use a ternary, not &&, for conditionals
- `rendering-usetransition-loading` - Prefer useTransition for loading state
- `rendering-resource-hints` - Use React DOM resource hints for preloading
- `rendering-script-defer-async` - Use defer or async on script tags

### 7. JavaScript performance (LOW-MEDIUM)

- `js-batch-dom-css` - Group CSS changes via classes or cssText
- `js-index-maps` - Build a Map for repeated lookups
- `js-cache-property-access` - Cache object properties in loops
- `js-cache-function-results` - Cache function results in a module-level Map
- `js-cache-storage` - Cache localStorage/sessionStorage reads
- `js-combine-iterations` - Combine multiple filter/map passes into one loop
- `js-length-check-first` - Check array length before an expensive comparison
- `js-early-exit` - Return early from functions
- `js-hoist-regexp` - Hoist RegExp creation outside loops
- `js-min-max-loop` - Use a loop for min/max instead of sort
- `js-set-map-lookups` - Use Set/Map for O(1) lookups
- `js-tosorted-immutable` - Use toSorted() for immutability
- `js-flatmap-filter` - Use flatMap to map and filter in one pass
- `js-request-idle-callback` - Defer non-critical work to browser idle time

### 8. Advanced patterns (LOW)

- `advanced-effect-event-deps` - Keep `useEffectEvent` results out of effect deps
- `advanced-event-handler-refs` - Store event handlers in refs
- `advanced-init-once` - Initialise the app once per app load
- `advanced-use-latest` - useLatest for stable callback refs
Files in this package (75)
  • LICENSE.txt 2 KB
  • SKILL.md 8 KB
  • local-notes.md 4 KB
  • rules/_sections.md 2 KB
  • rules/_template.md 1 KB
  • rules/advanced-effect-event-deps.md 2 KB
  • rules/advanced-event-handler-refs.md 1 KB
  • rules/advanced-init-once.md 1 KB
  • rules/advanced-use-latest.md 1 KB
  • rules/async-api-routes.md 1 KB
  • rules/async-cheap-condition-before-await.md 1 KB
  • rules/async-defer-await.md 2 KB
  • rules/async-dependencies.md 1 KB
  • rules/async-parallel.md 1 KB
  • rules/async-suspense-boundaries.md 2 KB
  • rules/bundle-analyzable-paths.md 2 KB
  • rules/bundle-barrel-imports.md 3 KB
  • rules/bundle-conditional.md 1 KB
  • rules/bundle-defer-third-party.md 1 KB
  • rules/bundle-dynamic-imports.md 1 KB
  • rules/bundle-preload.md 1 KB
  • rules/client-event-listeners.md 2 KB
  • rules/client-localstorage-schema.md 2 KB
  • rules/client-passive-event-listeners.md 2 KB
  • rules/client-swr-dedup.md 1 KB
  • rules/js-batch-dom-css.md 3 KB
  • rules/js-cache-function-results.md 2 KB
  • rules/js-cache-property-access.md 1 KB
  • rules/js-cache-storage.md 2 KB
  • rules/js-combine-iterations.md 1 KB
  • rules/js-early-exit.md 1 KB
  • rules/js-flatmap-filter.md 1 KB
  • rules/js-hoist-regexp.md 1 KB
  • rules/js-index-maps.md 1 KB
  • rules/js-length-check-first.md 2 KB
  • rules/js-min-max-loop.md 2 KB
  • rules/js-request-idle-callback.md 3 KB
  • rules/js-set-map-lookups.md 1 KB
  • rules/js-tosorted-immutable.md 2 KB
  • rules/rendering-activity.md 1 KB
  • rules/rendering-animate-svg-wrapper.md 1 KB
  • rules/rendering-conditional-render.md 1 KB
  • rules/rendering-content-visibility.md 1 KB
  • rules/rendering-hoist-jsx.md 1 KB
  • rules/rendering-hydration-no-flicker.md 2 KB
  • rules/rendering-hydration-suppress-warning.md 1 KB
  • rules/rendering-resource-hints.md 2 KB
  • rules/rendering-script-defer-async.md 2 KB
  • rules/rendering-svg-precision.md 1 KB
  • rules/rendering-usetransition-loading.md 2 KB
  • rules/rerender-defer-reads.md 1 KB
  • rules/rerender-dependencies.md 1 KB
  • rules/rerender-derived-state-no-effect.md 1 KB
  • rules/rerender-derived-state.md 1 KB
  • rules/rerender-functional-setstate.md 3 KB
  • rules/rerender-lazy-state-init.md 2 KB
  • rules/rerender-memo-with-default-value.md 1 KB
  • rules/rerender-memo.md 1 KB
  • rules/rerender-move-effect-to-event.md 1 KB
  • rules/rerender-no-inline-components.md 2 KB
  • rules/rerender-simple-expression-in-memo.md 1 KB
  • rules/rerender-split-combined-hooks.md 2 KB
  • rules/rerender-transitions.md 1 KB
  • rules/rerender-use-deferred-value.md 2 KB
  • rules/rerender-use-ref-transient-values.md 2 KB
  • rules/server-after-nonblocking.md 2 KB
  • rules/server-auth-actions.md 3 KB
  • rules/server-cache-lru.md 1 KB
  • rules/server-cache-react.md 2 KB
  • rules/server-dedup-props.md 2 KB
  • rules/server-hoist-static-io.md 4 KB
  • rules/server-no-shared-module-state.md 2 KB
  • rules/server-parallel-fetching.md 2 KB
  • rules/server-parallel-nested-fetching.md 1 KB
  • rules/server-serialization.md 1 KB

Versions

RepositoryScoreLicence
This page · henkisdabro/wookstar-claude-plugins90MIT
acaprino/alfio-claude-plugins100MIT
acaprino/alfio-claude-plugins100MIT
acaprino/alfio-claude-plugins100MIT
acaprino/alfio-claude-plugins100MIT
acaprino/alfio-claude-plugins100MIT
akillness/jeo-skills100MIT
kamiazya/whiteboard100Apache-2.0
acaprino/alfio-claude-plugins100MIT

Database snapshot: 13.11.2026 · package version a6c5f4d0f472 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 2 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100vercel-react-best-practices
    Use when writing, reviewing or refactoring React/Next.js code for performance: rendering, data fetching, bundle size.
  • 95vercel-react-best-practices
    React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching,…
  • 100vercel-react-best-practices
    React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching,…
  • 95vercel-react-best-practices
    React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching,…
  • 100vercel-react-best-practices
    React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching,…
  • 100trove-react-best-practices
    React and Next.js performance optimization guidelines (Vercel Engineering, 70 rules across 8 categories). Use when writing, reviewing, or refactoring React code specifically for performance: eliminating waterfalls, bundle size, re-render optimization, or server/client data…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.