Install the extension by following the guide here.
API Reference
Options
export interface Options {
/**
* Enable/disable scanning
* @default true
*/
enabled?: boolean;
/**
* Force React Scan to run in production (not recommended)
* @default false
*/
dangerouslyForceRunInProduction?: boolean;
/**
* Log renders to the console
* @default false
*/
log?: boolean;
/**
* Show toolbar bar
* @default true
*/
showToolbar?: boolean;
/**
* Animation speed
* @default "fast"
*/
animationSpeed?: "slow" | "fast" | "off";
onCommitStart?: () => void;
onRender?: (fiber: Fiber, renders: Array<Render>) => void;
onCommitFinish?: () => void;
}
scan(options: Options): Imperative API to start scanning
useScan(options: Options): Hook API to start scanning
setOptions(options: Options): void: Set options at runtime
getOptions(): Get the current options
onRender(Component, onRender: (fiber: Fiber, render: Render) => void): Hook into a specific component’s renders
Why React Scan?
React can be tricky to optimize.
The issue is that component props are compared by reference, not value. This is intentional – rendering can be cheap to run.
However, this makes it easy to accidentally cause unnecessary renders, making the app slow. Even production apps with hundreds of engineers can’t fully optimize their apps (see GitHub, Twitter, and Instagram).
React Scan automatically detects performance issues in your React app.
Quick Start
Try out a demo! →
Install
The
initcommand will automatically detect your framework, installreact-scanvia npm, and set up your project.Manual Installation
Install the package:
Then add the script tag to your app. Pick the guide for your framework:
Script Tag
Paste this before any scripts in your
index.html:Next.js (App Router)
Add this inside of your
app/layout.tsx:Next.js (Pages Router)
Add this into your
pages/_document.tsx:Vite
Example
index.htmlwith React Scan enabled:Remix
Add this inside your
app/root.tsx:Browser Extension
Install the extension by following the guide here.
API Reference
Optionsscan(options: Options): Imperative API to start scanninguseScan(options: Options): Hook API to start scanningsetOptions(options: Options): void: Set options at runtimegetOptions(): Get the current optionsonRender(Component, onRender: (fiber: Fiber, render: Render) => void): Hook into a specific component’s rendersWhy React Scan?
React can be tricky to optimize.
The issue is that component props are compared by reference, not value. This is intentional – rendering can be cheap to run.
However, this makes it easy to accidentally cause unnecessary renders, making the app slow. Even production apps with hundreds of engineers can’t fully optimize their apps (see GitHub, Twitter, and Instagram).
React Scan helps you identify these issues by automatically detecting and highlighting renders that cause performance issues.
Resources & Contributing
Want to try it out? Check the demo.
Looking to contribute? Check the Contributing Guide.
Want to talk to the community? Join our Discord.
Find a bug? Head to our issue tracker.
→ Start contributing on GitHub
Acknowledgments
License
React Scan is MIT-licensed open-source software by Aiden Bai, Million Software, Inc., and contributors.