Advanced debugging & performance optimization tool for ReactJS applications - Chrome Extension
npm install @nhonh/react-debugger

Advanced debugging & performance optimization tool for ReactJS applications.

---
``bash`
npx @nhonh/react-debugger
Or install to a specific folder:
`bash`
npx @nhonh/react-debugger ./my-extension
---
| Tab | Purpose | Key Metrics |
|-----|---------|-------------|
| š Timeline | Visual timeline of all React events | Renders, state changes, effects, errors |
| šÆ UI & State | Detect React anti-patterns | State mutations, missing/duplicate keys |
| ā” Performance | Track component performance | Render count, duration, Core Web Vitals |
| š¾ Memory | Monitor memory usage | Heap size, growth rate, leak detection |
| š Side Effects | Analyze useEffect hooks | Missing cleanups, dependency issues |
| š CLS | Layout stability monitoring | Cumulative Layout Shift score |
| šļø Redux | Redux state debugging | State tree, action history |
---
`bash`
npx @nhonh/react-debugger

1. Open Chrome ā Navigate to chrome://extensions/
2. Enable Developer mode (toggle top-right)
3. Click "Load unpacked"
4. Select your installation folder

1. Open any React website
2. Press F12 to open DevTools
3. Click the "React Debugger" tab

---
1. Open the Performance tab
2. Look at "Top Re-rendering Components" table
3. Components with high render counts need optimization

What the render triggers mean:
| Trigger | Cause | Solution |
|---------|-------|----------|
| props | Parent passed new props | Use React.memo() |state
| | Component's state changed | Reduce state updates |context
| | Context value changed | Split into smaller contexts |parent
| | Parent component re-rendered | Memoize this component |
1. Open the UI & State tab
2. Issues are sorted by severity (Error ā Warning ā Info)
3. Click any issue to see details and fix suggestions

Common issues detected:
`jsx
// ā DIRECT_STATE_MUTATION
const [items, setItems] = useState([]);
items.push(newItem); // Mutating directly!
setItems(items);
// ā
Fixed
setItems([...items, newItem]);
`
`jsx
// ā INDEX_AS_KEY
{items.map((item, i) =>
// ā
Fixed
{items.map(item =>
$3
1. Open the Memory tab
2. Click "Start Monitoring"
3. Use your app for a few minutes
4. Check the Growth Rate - should be near 0 KB/s

Memory health indicators:
| Usage | Status | Action |
|-------|--------|--------|
| < 70% | ā
Healthy | No action needed |
| 70-90% | ā ļø Warning | Monitor closely |
| > 90% | š“ Critical | Investigate immediately |
$3
1. Open the Timeline tab
2. Filter by event type (renders, state, effects, errors)
3. Click any event to see related events highlighted

Event types:
| Icon | Type | What it captures |
|------|------|------------------|
| š | Render | Component mounts and re-renders |
| š¦ | State | useState and Redux state changes |
| ā” | Effect | useEffect runs and cleanups |
| ā | Error | JavaScript errors and crashes |
| š§ | Memory | Memory usage snapshots |
---
$3
Find issues with
useEffect hooks that cause bugs and memory leaks.

Issues detected:
| Issue | Severity | Problem |
|-------|----------|---------|
| MISSING_CLEANUP | ā ļø Warning | Effect doesn't clean up timers/listeners |
| MISSING_DEP | ā ļø Warning | Variable used but not in dependency array |
| INFINITE_LOOP_RISK | š“ Error | Effect updates state it depends on |
| STALE_CLOSURE | ā ļø Warning | Callback captures outdated values |
Example fixes:
`jsx
// ā Missing cleanup - causes memory leak
useEffect(() => {
const id = setInterval(() => tick(), 1000);
// Timer keeps running after unmount!
}, []);// ā
With cleanup
useEffect(() => {
const id = setInterval(() => tick(), 1000);
return () => clearInterval(id); // Cleanup!
}, []);
``jsx
// ā Stale closure - always logs initial value
useEffect(() => {
const handler = () => console.log(count);
window.addEventListener('click', handler);
return () => window.removeEventListener('click', handler);
}, []); // Missing count dependency!// ā
Fixed - re-subscribe when count changes
useEffect(() => {
const handler = () => console.log(count);
window.addEventListener('click', handler);
return () => window.removeEventListener('click', handler);
}, [count]);
`---
$3
Monitor Cumulative Layout Shift - elements jumping around causes poor UX.

CLS Score:
| Score | Rating | User Experience |
|-------|--------|-----------------|
| < 0.1 | ā
Good | Stable, no jumps |
| 0.1 - 0.25 | ā ļø Needs Work | Noticeable shifts |
| > 0.25 | š“ Poor | Frustrating, elements jump |
Common causes & fixes:
`jsx
// ā Image without dimensions - causes shift when loaded

// ā
With dimensions - space reserved

``jsx
// ā Dynamic content pushes things down
{loaded && }// ā
Reserve space while loading
{loaded ? : }
`Top shift sources table shows which elements cause the most shifts - fix those first!
---
šÆ Common Debugging Scenarios
$3
`
1. Performance tab ā Check "Slowest Components"
2. Look for render times > 16ms
3. Enable "React Scan" to see re-renders visually
4. Fix components with excessive renders
`$3
`
1. Memory tab ā Start Monitoring
2. Navigate around your app
3. If growth rate stays positive ā memory leak
4. Side Effects tab ā Check for missing cleanups
`$3
`
1. CLS tab ā See shift score
2. Check "Top Shift Sources" table
3. Add width/height to images
4. Reserve space for dynamic content
`$3
`
1. Redux tab ā Expand state tree
2. Check Action History for unexpected actions
3. Use Action Dispatcher to test
`---
šļø Redux DevTools (Powerful Feature!)
The Redux tab provides a complete debugging experience:
$3
Click any value to edit it directly - changes apply immediately!
`
State Tree:
ā¼ user
āā name: "John" ā Click to edit ā "Jane" ā Enter ā
āā role: "user" ā Click ā "admin" ā See UI change!
āā balance: 100 ā Click ā 0 ā Test empty state
`$3
Reorder or delete array items with one click:
`
ā¼ cart.items: Array(3)
āā [0]: Book [ā] [ā] [Ć] ā Move up/down or delete
āā [1]: Pen [ā] [ā] [Ć]
āā [2]: Paper [ā] [ā] [Ć]
`$3
Test your reducers without writing code:
`
Type: cart/addItem
Payload: { "productId": 123, "quantity": 2 }
[Dispatch] ā Watch state update instantly!
`$3
| Scenario | Action |
|----------|--------|
| Test admin features | Edit
user.role ā "admin" |
| Test empty states | Edit posts ā [] |
| Test error handling | Dispatch api/error action |
| Test loading UI | Dispatch fetch/pending action |

---
āØļø CLI Options
`bash
npx @nhonh/react-debugger [destination] [options]Options:
-v, --version Show version number
-h, --help Show help
Examples:
npx @nhonh/react-debugger # Interactive mode
npx @nhonh/react-debugger ./extension # Install to ./extension
``---
- Getting Started Guide - Detailed setup instructions
- Understanding Each Tab - Deep dive into all features
- Troubleshooting - Common issues and solutions
---
- GitHub Repository
- Report Issues
- Changelog
---
- Node.js >= 18.0.0
- Chrome, Brave, Edge, or any Chromium-based browser
- React 16+ application
---
MIT Ā© NhoNH