react-expert

Diagnose and fix React hooks, rendering, state, and SSR issues.

3|Updated Jan 15, 2026
One-click install
npx skills add https://github.com/trudyan141/my-antigravity-agents-kit --skill react-expert-trudyan141
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-expert
Source: https://github.com/trudyan141/my-antigravity-agents-kit/tree/main/templates/.agent/skills/react-expert
Command: npx skills add https://github.com/trudyan141/my-antigravity-agents-kit --skill react-expert-trudyan141

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? React developers frequently encounter cryptic errors like invalid hook calls, infinite re-render loops, hydration mismatches, and memory leaks from uncleaned effects. This Skill provides structured diagnosis playbooks and prioritized fixes for the most common React 18/19 problems. ## Core Features & Use Cases - Problem Playbooks: Step-by-step diagnosis and fixes for hooks hygiene, rendering performance, effects and lifecycle, state management, SSR/RSC issues, and component patterns. - Environment Detection: Automatically detects React version, build tool (Next.js, Vite, Webpack, CRA), Strict Mode, and router setup before applying fixes. - Code Review Checklist: A comprehensive checklist covering hooks compliance, performance patterns, state management, and component design for reviewing React code. - Use Case: When you see "Too many re-renders" or "Hydration failed" errors, invoke this Skill to get targeted grep-based diagnosis commands and progressive fixes from minimal patches to complete refactors. ## Quick Start Ask the AI to diagnose why my React component keeps re-rendering infinitely and fix the useEffect dependency issue.

Frequently Asked Questions about react-expert

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

FAQPage Schema
How do I fix "Too many re-renders" errors in React?

Too many re-renders errors occur when state updates happen during the render phase or in infinite loops. Move state updates to event handlers, fix useEffect dependency arrays, and check for functions called directly in render instead of passed as callbacks.

How to fix missing dependency warnings in useEffect?

Add the missing values to the dependency array, or restructure the effect so it does not depend on them. For stable references, wrap functions in useCallback and values in useMemo, or extract complex logic into a custom hook.

Why does React hydration fail in Next.js?

Hydration fails when server-rendered HTML differs from client output, often caused by browser-only APIs like localStorage, Date.now(), or Math.random() running during render. Guard client-only code with typeof window checks or move it into useEffect.

Does this Skill work with React Server Components?

Yes, it includes a dedicated SSR/RSC playbook covering hydration mismatches, server-client data inconsistencies, and browser API usage in server components. It detects App Router patterns and recommends fixes like dynamic imports with ssr disabled.

When should I use React.memo and useMemo?

Use React.memo for components that re-render often with the same props, and useMemo for expensive computations. Avoid premature optimization—profile with React DevTools first, since overusing memoization adds complexity without measurable benefit.

What are the limitations of this React diagnosis approach?

The Skill defers specialized concerns to other experts: performance profiling goes to react-performance-expert, CSS-in-JS to css-styling-expert, accessibility to accessibility-expert, and component testing to a testing expert. It focuses on core React patterns and errors.