Installation
The fastest way to get started is with the automatic setup command:Run the init command
The CLI will detect your framework and configure everything automatically:
What does this command do?
What does this command do?
The
init command:- Detects your framework (Next.js, Vite, Remix, etc.)
- Detects your package manager (npm, pnpm, yarn, bun)
- Installs
react-scanas a dev dependency - Adds the necessary script tags to your project
- Shows a preview of changes before applying them
First Steps
Once React Scan is running, try these interactions:Toggle scanning
Toggle scanning
Click the toolbar icon to enable/disable render detection. When enabled, components will be highlighted as they re-render:
- Red outline: Slow render (potential performance issue)
- Yellow outline: Fast render
- Gray outline: Unnecessary render (no DOM changes)
Inspect a component
Inspect a component
Click on any highlighted component to inspect it. You’ll see:
- Component name and render count
- What changed (props, state, or context)
- Render duration
- Component tree hierarchy
View performance metrics
View performance metrics
The toolbar shows:
- FPS meter: Current frames per second
- Slowdown count: Number of performance issues detected
- Settings: Configure animation speed, logging, and more
Using the API
For programmatic control, use thescan() function:
Configuration Options
Customize React Scan’s behavior with these options:Example: Detecting Issues
Here’s a simple example showing how React Scan helps identify performance problems:TodoItem components highlighted in red when using the problematic version. After optimization, the unnecessary renders disappear.
Runtime Control
Change options at runtime using the API:Monitor Specific Components
Track renders for specific components:Next Steps
Now that React Scan is running, explore these topics:Understanding Renders
Learn what causes renders and how to prevent unnecessary ones
Performance Optimization
Best practices for React performance
Toolbar Guide
Master the React Scan toolbar features
API Reference
Complete API documentation
Troubleshooting
React Scan isn't showing up
React Scan isn't showing up
Make sure React Scan is loaded before React runs. The script must be in the
<head> before any React code.Check the console for this error:No renders are being detected
No renders are being detected
- Verify scanning is enabled (toolbar icon should be active)
- Ensure you’re in development mode (React Scan disables in production by default)
- Check that components are actually re-rendering by interacting with your app
Performance overhead
Performance overhead
React Scan is designed for development use. If you notice performance issues:
- Disable
logoption (adds significant overhead) - Set
animationSpeedto'off' - Disable
trackUnnecessaryRenders - Use
enabled: falsewhen not actively debugging
TypeScript errors
TypeScript errors
Install type definitions:Types are included in the package. If you’re using the global script tag, add:
Need more help? Join our Discord community or open an issue on GitHub.
