Author: NhoNH
Version: 1.0.0
License: MIT
Advanced debugging & performance optimization tool for ReactJS applications.
- π― UI & State Issues - Detect direct state mutation, missing keys, index as key
- β‘ Performance Analysis - Track re-renders, identify excessive renders
- π Side Effects - Find missing cleanup, dependency issues in useEffect
- π CLS Monitor - Track Cumulative Layout Shift in real-time
- ποΈ Redux DevTools - View state tree, dispatch actions manually
- π Timeline - Visual timeline of all React events
- πΎ Memory - Monitor memory usage and detect leaks
npx react-debuggerThen load the extension in Chrome:
- Open
chrome://extensions/ - Enable Developer mode
- Click Load unpacked
- Select the downloaded folder
git clone https://github.com/nhonh/react-debugger-extension.git
cd react-debugger-extension
npm install
npm run buildThen load the dist folder in Chrome:
- Open
chrome://extensions/ - Enable Developer mode
- Click Load unpacked
- Select the
distfolder
- Download
react-debugger.zipfrom GitHub Releases - Extract the ZIP
- Load the extracted folder in Chrome as above
Test on any React website or local development server:
- https://react.dev (official React docs)
- https://reactjs.org
- Any local React app (Create React App, Next.js, Vite, etc.)
- Press
F12orCmd+Option+I(Mac) /Ctrl+Shift+I(Windows) - Find the "React Debugger" tab in the DevTools panel tabs
- Shows issues with state management and list keys
- Click on any issue to expand details
- Follow suggestions to fix problems
- Shows component render statistics
- Lists top re-rendering components
- Identifies render triggers (props, state, context)
- Lists useEffect issues
- Identifies missing cleanup functions
- Shows dependency problems
- Real-time CLS score monitoring
- Shows top layout shift contributors
- Timeline of shift events
- View Redux state tree (if Redux is detected)
- See action history
- Dispatch custom actions for testing
Create a React app with this code:
function App() {
const items = ['a', 'b', 'c'];
return (
<ul>
{items.map((item, index) => (
<li key={index}>{item}</li> {/* Using index as key - will be flagged */}
))}
</ul>
);
}Expected: Warning about using index as key in UI & State tab.
function Counter() {
const [count, setCount] = useState(0);
// This will cause excessive renders
useEffect(() => {
const id = setInterval(() => setCount((c) => c + 1), 100);
return () => clearInterval(id);
}, []);
return <div>{count}</div>;
}Expected: Warning about excessive re-renders in Performance tab.
function Timer() {
useEffect(() => {
const id = setInterval(() => {
console.log("tick");
}, 1000);
// Missing: return () => clearInterval(id);
}, []);
return <div>Timer</div>;
}Expected: Warning about missing cleanup in Side Effects tab.
Load a page with images without dimensions:
<img src="large-image.jpg" />
<!-- No width/height -->Expected: CLS score > 0 shown in CLS tab when image loads.
npm installnpm run buildnpm run devnpm run packagereact-debugger-extension/
βββ src/
β βββ background/ # Service worker
β βββ content/ # Content script (CLS monitoring)
β βββ inject/ # Page script (React fiber hook)
β βββ devtools/ # DevTools page entry
β βββ panel/ # React panel UI
β β βββ components/ # Reusable components
β β βββ tabs/ # Tab content components
β β βββ styles/ # CSS styles
β βββ types/ # TypeScript types
β βββ utils/ # Utility functions
βββ public/
β βββ manifest.json # Extension manifest
β βββ icons/ # Extension icons
βββ dist/ # Build output (load this in Chrome)
βββ package.json
- Make sure you loaded the
distfolder (not the root) - Refresh the page after loading extension
- Check for errors in
chrome://extensions/
- The page must use React 16+ with fiber architecture
- Try refreshing the page
- Check console for errors
- The extension only shows issues when they're found
- Try the test scenarios above
- Check that React is in development mode for some features
For a comprehensive debugging guide covering all tabs, metrics, and debugging strategies for developers at every skill level, see:
The guide includes:
- Detailed explanation of each tab and its metrics
- Debugging workflows for Fresher, Mid-level, and Senior developers
- Common issues and their fixes with code examples
- Best practices for Performance, Memory, State Management, and Layout Stability
- Quick reference tables for thresholds and color coding
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - Copyright (c) 2025 NhoNH