CtrlK
BlogDocsLog inGet started
Tessl Logo

react-best-practices

Client-side React performance optimization patterns.

36

Quality

32%

Does it follow best practices?

Impact

No eval scenarios have been run

SecuritybySnyk

Passed

No known issues

Optimize this skill with Tessl

npx tessl skill review --optimize ./frontend/.claude/skills/react-best-practices/SKILL.md
SKILL.md
Quality
Evals
Security

React Best Practices

Client-side React optimization patterns for Cloud UI. 29 rules organized by category and impact.

Activation Conditions

  • Performance optimization tasks
  • Component re-render issues
  • Bundle size concerns
  • useEffect/useMemo patterns

Rules by Category

Bundle Optimization (CRITICAL)

RuleKey Point
bundle-barrel-importsImport from source files, not barrel index.ts
bundle-code-splittingReact.lazy + Suspense for heavy components, conditional loads, deferred 3rd-party
bundle-preloadPreload critical resources

Re-render Prevention (HIGH)

RuleKey Point
rerender-memoMemoize expensive computations
rerender-dependenciesMinimize hook dependency arrays
rerender-derived-stateCompute during render, not in effects
rerender-functional-setstatesetState(prev => ...) to avoid stale closures
rerender-lazy-state-inituseState(() => expensive()) not useState(expensive())
rerender-simple-expression-in-memoDon't memoize trivial expressions
rerender-transitionsuseTransition for non-urgent updates
rerender-defer-readsRead URL params / storage inside callbacks, not at render

Rendering (MEDIUM)

RuleKey Point
rendering-conditional-renderShort-circuit with && / ternary, avoid render in effects
rendering-hoist-jsxMove static JSX outside components
rendering-content-visibilityCSS content-visibility: auto for off-screen
rendering-activityReact <Activity> for hidden UI
rendering-animate-svg-wrapperWrap animated SVGs to isolate re-renders
rendering-svg-precisionLimit SVG coordinate precision

Async (MEDIUM)

RuleKey Point
async-suspense-boundariesGranular <Suspense> boundaries
async-defer-awaitDon't await non-blocking work
async-dependenciesLoad deps in parallel, not sequentially

JavaScript (MEDIUM)

RuleKey Point
js-caching-patternsModule-level Map caches for repeated calls + storage reads
js-batch-dom-cssBatch DOM reads/writes to avoid layout thrashing
js-index-mapsPre-index arrays into Maps for O(1) lookups
js-length-check-firstCheck .length before expensive operations
js-tosorted-immutableUse .toSorted() / .toReversed() for immutable transforms

RegExp hoisting is enforced by Biome (useTopLevelRegex).

Browser (MEDIUM)

RuleKey Point
client-event-listenersClean up event listeners in useEffect return
client-passive-event-listeners{ passive: true } for scroll/touch handlers

Advanced (LOW)

RuleKey Point
advanced-event-handler-refsStable callback refs to avoid child re-renders
advanced-use-latestuseLatest pattern for always-current values in callbacks
Repository
redpanda-data/console
Last updated
Created

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.