Options Interface
TheOptions interface allows you to customize React Scan’s behavior. Pass these options to the scan() function or configure them via build tool plugins.
Configuration Options
Enable or disable scanning.Recommended usage:This ensures React Scan only runs in development mode.
Force React Scan to run in production.
Log renders to the console.Example output:
Show or hide the toolbar.If you set this to
true and set enabled to false, the toolbar will still show, but scanning will be disabled.The toolbar provides:- Real-time FPS monitoring
- Render count notifications
- Inspector controls
Control the animation speed of render highlights.
'fast'- Quick flash animations (recommended)'slow'- Slower, more visible animations'off'- No animations
Track unnecessary renders and mark their outlines gray when detected.An unnecessary render is defined as a component re-rendering with no change to its corresponding DOM subtree.
Show the FPS meter in the toolbar.Displays real-time frames per second to help identify performance bottlenecks.
Show the number of slowdown notifications in the toolbar.Helps track how many performance issues have been detected during your session.
Allow React Scan to run inside iframes.By default, React Scan is disabled in iframe contexts to avoid interference with embedded content.
Enable verbose internal error logging.Useful when React Scan is not behaving as expected and you want to provide information to maintainers when submitting an issue.Example:
Lifecycle Hooks
Callback fired when a React commit phase starts.
Callback fired when a component renders.Provides access to the fiber node and render information.See Types for
Fiber and Render type definitions.Callback fired when a React commit phase finishes.
Example Configurations
Basic Development Setup
Performance Debugging
Minimal UI
Local Storage
React Scan persists certain options to localStorage for convenience:enabledlogshowToolbaranimationSpeedshowFPSshowNotificationCountallowInIframetrackUnnecessaryRenders
onCommitStart, onRender, onCommitFinish) are not persisted.
See Also
- Types - Type definitions for Fiber, Render, and more
- CLI - Command-line interface
- Vite Plugin - Vite integration