Resources
Optimization
Optimize your Next.js project with React Scan and improve your application’s performance.
React Scan
React Scan is a powerful tool for analyzing and optimizing your React applications. This guide will walk you through how to add React Scan to your Next.js project.
Installation
You can add React Scan to your Next.js project in two ways:
Method 1: Using the Script Tag
Add React Scan to your root layout by importing the Script
component from Next.js:
src/app/layout.tsx
Method 2: Using the React Scan Component
Install React Scan as a development dependency:
Create a new component like src/components/ReactScan.tsx
:
src/components/ReactScan.tsx
Then, add the ReactScan
component to your providers component or root layout:
src/components/global/providers.tsx
Usage
React Scan will automatically analyze your application and identify unused components, props, and other optimizations opportunities.
Was this page helpful?