React Scan is a performance monitoring tool for React applications designed to automatically detect re-render issues and potential performance bottlenecks. Unlike React's built-in `Profiler` or other tools like `Why Did You Render?`, `react-scan` aims to provide simple visual cues and requires minimal to no code changes for integration. It offers a portable API accessible via npm, CDN script tags, or a command-line interface, making it versatile for various development workflows across different React frameworks. The package is currently at version 0.5.3 and maintains an active development cycle with a moderate release cadence, though previous versions noted a period of slower releases. Key features include highlighting re-rendering components, providing notifications for performance issues, and offering a persistent, draggable toolbar for inspection.
npm install react-scanVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to integrate React Scan into a React application, enabling it conditionally for development environments. It shows the basic `scan()` function call with an `Options` object, and a simple React component structure that would trigger re-renders visible via the React Scan toolbar.
No direct fix; the feature was intentionally removed. Developers should be aware of its absence and rely on other available inspection features.
Upgrade `react-scan` to version `0.3.3` or newer to resolve the misattribution of hot reloading events as performance issues.
For production or universal environments, use the subpath import: `import { scan } from 'react-scan/all-environments';`. This import is designed to work correctly in all environments.Users should be aware of the new drag-to-hide functionality. If the toolbar seems 'missing', it might have been thrown off-page. Dragging from the edge of the screen can restore it.
Upgrade `react-scan` to version `0.4.3` or higher to benefit from the memory leak fix and ensure stable performance during extended debugging sessions.
For production or universal usage (where `scan()` needs to be active in all environments), explicitly use the subpath import: `import { scan } from 'react-scan/all-environments';`.Upgrade `react-scan` to version `0.3.3` or a later version. This update includes a fix that prevents the tool from misinterpreting hot reloads.
Upgrade `react-scan` to version `0.4.0` or higher. This version introduced the ability to 'throw' the toolbar off the edge of the screen, which hides it and persists across reloads.