React Scan is a performance monitoring tool that helps identify slow renders and unnecessary re-renders in React applications.
bun run dev:scanbun run dev:scanREACT_SCAN_ENABLED=true bun run devReact Scan is configured via environment variables:
REACT_SCAN_ENABLED=true- Enable React Scan (required to run)REACT_SCAN_LOG=true- Enable console logging for detailed diagnosticsREACT_SCAN_SLOW_THRESHOLD=20- Set threshold for slow render detection (default: 10ms)
You can also use the React Scan CLI tool to scan a running application:
bunx react-scan localhost:3000- Only runs in development mode (
NODE_ENV === 'development') - Disabled on all deployment platforms automatically
- Requires explicit opt-in via
REACT_SCAN_ENABLED=true - Multiple environment checks prevent accidental production activation
React Scan adds minimal overhead but can affect performance when:
- Logging is enabled (
REACT_SCAN_LOG=true) - Tracking unnecessary renders
- Many components are rendering simultaneously
Use it only when actively debugging performance issues.