| name | react-devtools-plus |
| description | Drop-in Vite/Webpack plugin that mirrors React Fiber trees, profiles renders, and provides visual debugging overlay for React 16-19 apps. |
| triggers | ["add react devtools plus to my project","set up react debugging overlay","configure react devtools plus plugin","profile react component renders","inspect react fiber tree","debug react components in development","add react devtools to vite","integrate react debugging tools"] |
React DevTools Plus
Skill by ara.so — Devtools Skills collection.
React DevTools Plus is an open-source build tool plugin that provides visual debugging for React applications. It mirrors your React Fiber tree in real-time, profiles component renders, and offers a keyboard-first overlay—all with zero impact on production builds.
What It Does
- Fiber Tree Mirroring: Automatically instruments React Fiber roots to visualize component hierarchies
- Timeline Profiling: Tracks component renders and performance metrics
- Floating Overlay: Toggle with
Alt/Option + Shift + D for inline debugging
- Asset Inspection: Browse and inspect project assets (images, fonts, etc.)
- Editor Integration: Click-to-open components in your IDE
- React 16-19 Support: Works with React 16.8+, 17, 18, and 19
- Dev-Only: Completely removed from production bundles
Installation
For Vite Projects
pnpm add -D react-devtools-plus
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import { reactDevToolsPlus } from 'react-devtools-plus/vite'
export default defineConfig({
plugins: [
react(),
reactDevToolsPlus(),
],
})
For Webpack Projects
npm install -D react-devtools-plus
const { reactDevToolsPlus } = require('react-devtools-plus/webpack')
module.exports = {
plugins: [
reactDevToolsPlus(),
],
}
Configuration
Basic Configuration
import { reactDevToolsPlus } from 'react-devtools-plus/vite'
export default defineConfig({
plugins: [
react(),
reactDevToolsPlus({
overlay: true,
base: '/__react_devtools__',
launchEditor: 'code',
}),
],
})
Advanced Configuration
import { reactDevToolsPlus } from 'react-devtools-plus/vite'
export default defineConfig({
plugins: [
react(),
reactDevToolsPlus({
overlay: false,
base: '/__debug__',
launchEditor: 'webstorm',
}),
],
})
Webpack Configuration
const { reactDevToolsPlus } = require('react-devtools-plus/webpack')
module.exports = {
mode: 'development',
plugins: [
reactDevToolsPlus({
overlay: true,
base: '/__react_devtools__',
launchEditor: 'code',
}),
],
}
Usage Patterns
Accessing DevTools
Method 1: Keyboard Shortcut
Press Alt + Shift + D (Windows/Linux) or Option + Shift + D (macOS) to toggle the floating overlay.
Method 2: Direct URL
Navigate to http://localhost:5173/__react_devtools__/ (adjust port/base as configured).
Method 3: Toggle Overlay Visibility
Press Alt + Shift + R (Windows/Linux) or Option + Shift + R (macOS) to toggle overlay visibility.
Press Escape to close the overlay.
Component Tree Inspection
Once DevTools is open:
- View Component Hierarchy: The left panel shows your React component tree in real-time
- Inspect Props/State: Click any component to view its props, state, and hooks
- Open in Editor: Click the "Open in Editor" button to jump to source code
- Search Components: Use the search bar to filter components by name
Timeline Profiling
- Switch to the Timeline tab
- Click "Start Recording" to begin profiling
- Interact with your app (trigger renders)
- Click "Stop Recording" to analyze performance
- Review render durations, commit phases, and component updates
Asset Inspection
- Switch to the Assets tab
- Browse images, fonts, and other project assets
- Click assets to view details and usage
- Copy asset paths for use in your code
Real-World Examples
Example 1: Next.js App with Vite
import { defineConfig } from 'vite'
import { reactDevToolsPlus } from 'react-devtools-plus/vite'
export default defineConfig({
plugins: [
reactDevToolsPlus({
overlay: true,
base: '/__devtools__',
}),
],
})
Example 2: React SPA with Custom Editor
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import { reactDevToolsPlus } from 'react-devtools-plus/vite'
export default defineConfig({
plugins: [
react(),
reactDevToolsPlus({
overlay: true,
launchEditor: 'cursor',
}),
],
})
Example 3: Monorepo with Multiple React Apps
import { defineConfig } from 'vite'
import { reactDevToolsPlus } from 'react-devtools-plus/vite'
export default defineConfig({
plugins: [
reactDevToolsPlus({
base: '/__admin_devtools__',
}),
],
})
import { defineConfig } from 'vite'
import { reactDevToolsPlus } from 'react-devtools-plus/vite'
export default defineConfig({
plugins: [
reactDevToolsPlus({
base: '/__customer_devtools__',
}),
],
})
Example 4: Conditional DevTools (Environment-based)
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import { reactDevToolsPlus } from 'react-devtools-plus/vite'
export default defineConfig(({ mode }) => ({
plugins: [
react(),
(mode === 'development' || mode === 'staging') && reactDevToolsPlus({
overlay: mode === 'development',
base: '/__devtools__',
}),
].filter(Boolean),
}))
Example 5: Webpack with React and TypeScript
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const { reactDevToolsPlus } = require('react-devtools-plus/webpack')
module.exports = {
mode: 'development',
entry: './src/index.tsx',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
},
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
plugins: [
new HtmlWebpackPlugin({
template: './public/index.html',
}),
reactDevToolsPlus({
overlay: true,
launchEditor: 'code',
}),
],
devServer: {
port: 3000,
hot: true,
},
}
Key Features & API
Plugin Options
interface ReactDevToolsPlusOptions {
overlay?: boolean
base?: string
launchEditor?: 'code' | 'webstorm' | 'cursor' | 'vim' | 'atom' | 'sublime' | string
}
Keyboard Shortcuts
| Shortcut | Action |
|---|
Alt/Option + Shift + D | Toggle DevTools overlay |
Alt/Option + Shift + R | Toggle overlay visibility |
Escape | Close overlay |
DevTools UI Tabs
- Component Tree: Real-time React Fiber tree visualization
- Timeline: Render profiling and performance metrics
- Assets: Project asset browser and inspector
- Settings: DevTools configuration and preferences
Troubleshooting
DevTools Not Appearing
Issue: Pressing the keyboard shortcut or navigating to the URL shows nothing.
Solutions:
- Ensure you're running in development mode (
NODE_ENV=development)
- Check that the plugin is correctly added to your Vite/Webpack config
- Verify your dev server is running and the port is correct
- Check browser console for errors
Overlay Blocks UI Elements
Issue: The floating overlay is interfering with app interaction.
Solutions:
reactDevToolsPlus({
overlay: false,
})
Or toggle visibility with Alt/Option + Shift + R.
"Open in Editor" Not Working
Issue: Clicking components doesn't open them in your editor.
Solutions:
reactDevToolsPlus({
launchEditor: 'code',
})
Ensure your editor's command-line tool is installed:
- VS Code: Install
code command via Command Palette → "Shell Command: Install 'code' command in PATH"
- Cursor: Similar to VS Code
- WebStorm: Ensure
webstorm command is in PATH
Components Not Showing in Tree
Issue: Some components are missing from the DevTools tree.
Solutions:
- Ensure you're using React 16.8+ (Hooks required)
- Check that components are mounted and rendered
- Verify React DevTools is instrumenting Fiber roots (check console for initialization logs)
- Try refreshing the DevTools panel
DevTools Affecting Production Build
Issue: DevTools code appears in production bundle.
Solutions:
The plugin should automatically exclude itself from production builds. Verify:
export default defineConfig(({ mode }) => ({
plugins: [
react(),
reactDevToolsPlus(),
],
}))
If issues persist:
export default defineConfig(({ mode }) => ({
plugins: [
react(),
mode === 'development' && reactDevToolsPlus(),
].filter(Boolean),
}))
Custom Base Path Not Working
Issue: DevTools not accessible at custom path.
Solutions:
reactDevToolsPlus({
base: '/__custom_path__',
})
Then navigate to: http://localhost:5173/__custom_path__/
Project Structure
React DevTools Plus is a monorepo with the following key packages:
react-devtools - Main Vite/Webpack plugin
react-devtools-client - DevTools UI client
react-devtools-core - Core functionality and plugin system
react-devtools-kit - State management and messaging
react-devtools-overlay - Floating overlay component
react-devtools-scan - Render scanning utilities
Development
If you need to contribute or debug the plugin itself:
git clone https://github.com/wzc520pyfm/react-devtools-plus.git
cd react-devtools-plus
pnpm install
pnpm dev
pnpm play
pnpm play:webpack
pnpm build
pnpm test
pnpm lint
Resources