Loading...
Loading...
Provides React 18/19 expertise including hooks, component patterns, performance optimization, state management, and Server Components. Use this skill for React component issues, hook errors, re-rendering problems, or state management challenges.
npx skill4agent add duck4nh/antigravity-kit react-expert# Detect React version
npm list react --depth=0 2>/dev/null | grep react@ || node -e "console.log(require('./package.json').dependencies?.react || 'Not found')" 2>/dev/null
# Check for React DevTools and build tools
if [ -f "next.config.js" ] || [ -f "next.config.mjs" ]; then echo "Next.js detected"
elif [ -f "vite.config.js" ] || [ -f "vite.config.ts" ]; then echo "Vite detected"
elif [ -f "webpack.config.js" ]; then echo "Webpack detected"
elif grep -q "react-scripts" package.json 2>/dev/null; then echo "Create React App detected"
else echo "Unknown build tool"
fi
# Check for Strict Mode and router
grep -r "React.StrictMode\|<StrictMode" src/ 2>/dev/null || echo "No Strict Mode found"
npm list react-router-dom @tanstack/react-router --depth=0 2>/dev/null | grep -E "(react-router-dom|@tanstack/react-router)" || echo "No router detected"# Check for hook violations
npx eslint src/ --rule 'react-hooks/rules-of-hooks: error' --rule 'react-hooks/exhaustive-deps: warn' 2>/dev/null || echo "No ESLint React hooks rules configured"
# Find useEffect patterns
grep -r "useEffect" --include="*.jsx" --include="*.tsx" src/ | head -10
# Check for render-phase state updates
grep -r "setState\|useState.*(" --include="*.jsx" --include="*.tsx" src/ | grep -v "useEffect\|onClick\|onChange"npm run lint 2>/dev/null || npx eslint src/ --ext .jsx,.tsx
npm test -- --watchAll=false --passWithNoTests 2>/dev/null || echo "No tests configured"# Check for React.memo usage
grep -r "React.memo\|memo(" --include="*.jsx" --include="*.tsx" src/ | wc -l
# Find potential performance issues
grep -r "map\|filter\|reduce" --include="*.jsx" --include="*.tsx" src/ | grep -v "useMemo\|useCallback" | head -5
# Check for object creation in render
grep -r "=.*{.*}" --include="*.jsx" --include="*.tsx" src/ | grep -v "useState\|useEffect" | head -5# Find effects without cleanup
grep -A 5 -r "useEffect" --include="*.jsx" --include="*.tsx" src/ | grep -B 5 -A 5 "useEffect" | grep -c "return.*(" || echo "No cleanup functions found"
# Check for async effects (anti-pattern)
grep -r "async.*useEffect\|useEffect.*async" --include="*.jsx" --include="*.tsx" src/
# Find potential memory leaks
grep -r "addEventListener\|setInterval\|setTimeout" --include="*.jsx" --include="*.tsx" src/ | grep -v "cleanup\|clear\|remove"# Check for memory leaks (if tests are configured)
npm test -- --detectLeaks --watchAll=false 2>/dev/null || echo "No test configuration for leak detection"# Find potential prop drilling patterns
grep -r "props\." --include="*.jsx" --include="*.tsx" src/ | wc -l
# Check Context usage
grep -r "useContext\|createContext" --include="*.jsx" --include="*.tsx" src/
# Look for direct state mutations
grep -r "\.push\|\.pop\|\.splice" --include="*.jsx" --include="*.tsx" src/ | grep -v "useState.*=\|setState"
# Find object rendering patterns
grep -r "{\w*}" --include="*.jsx" --include="*.tsx" src/ | grep -v "props\|style" | head -5# Check for client-only code
grep -r "window\.\|document\.\|localStorage\|sessionStorage" --include="*.jsx" --include="*.tsx" src/ | head -10
# Find server components (if using App Router)
grep -r "use server\|async function.*await" --include="*.jsx" --include="*.tsx" src/
# Check for hydration-sensitive code
grep -r "Date\(\)\|Math.random\(\)" --include="*.jsx" --include="*.tsx" src/typeof window !== 'undefined'ssr: false# Check component size and complexity
find src/ -name "*.jsx" -o -name "*.tsx" | xargs wc -l | sort -rn | head -10
# Find list rendering without keys
grep -r "\.map(" --include="*.jsx" --include="*.tsx" src/ | grep -v "key=" | head -5
# Check for ref usage
grep -r "useRef\|ref\.current" --include="*.jsx" --include="*.tsx" src/
# Find repeated patterns
grep -r "interface.*Props\|type.*Props" --include="*.tsx" src/ | wc -luseReact.memouseMemouseCallback