React DevTools
React DevTools is a debugging tool designed to debug React and React Native apps. It can be used in browsers by installing its extension and provides powerful React component inspection capabilities.
Overview
React DevTools provides React-specific debugging capabilities including:
- Component hierarchy inspection
- Props and state viewing and editing
- Performance profiling for React components
- Hooks inspection
- Component trace for style sources
Platform Support:
- ✅ Web Preview (Browser extension)
- ✅ Expo (Go / Dev Build)
- ❌ Release Build (APK/IPA)
React DevTools shows React components unlike Chrome DevTools which shows HTML elements. This is particularly useful for debugging component state and props in WaveMaker apps.
Available Panels
Components Panel
Shows React components in hierarchical structure with their props and state.
Profiler Panel
Collects timing information about each component to identify performance bottlenecks.
Installation
Browser Extension
React DevTools can be installed as an extension in Chrome, Firefox, and Edge browsers.
Chrome:
- Visit Chrome Web Store
- Click "Add to Chrome"
- Accept permissions
Firefox:
- Visit Firefox Add-ons
- Click "Add to Firefox"
- Accept permissions
Edge:
- Visit Edge Add-ons
- Click "Get"
- Accept permissions
Standalone Application
For React Native debugging without browser:
# Install globally
npm install -g react-devtools
# Or install for project
npm install --save-dev react-devtools
# Start standalone
react-devtools
Using React DevTools
Launching in Web Preview
- Install React DevTools browser extension
- Launch application web preview from Studio
- Click "REMOVE TOOLBAR" once preview loads
- Right-click anywhere and select Inspect
- Browser DevTools will open with two new panels:
- ⚛️ Components
- ⚛️ Profiler
Components Panel
Inspecting Component Hierarchy
The Components panel displays React components in a tree structure similar to the DOM tree, but showing React components instead of HTML elements.
Features:
- View component tree structure
- Select components to inspect
- Search for components by name
- Filter components
Viewing Props and State
When you select a component in the tree:
Right panel shows:
- Props – Data passed from parent component
- State – Component's internal state (if using state)
- Hooks – Hook values (if using hooks)
- Rendered by – Parent component information
For WaveMaker components:
- Props show widget configuration from Studio
- State shows current widget state
- Can view data binding values
Editing Props and State
You can modify props and state values directly in React DevTools to test behavior:
- Select component in tree
- In right panel, click on prop/state value
- Edit the value
- Press Enter to apply
- Component re-renders with new value
Use cases:
- Test component with different prop values
- Debug state-related issues
- Validate conditional rendering logic
Changes in React DevTools are temporary and reset on page reload. They're useful for testing but don't modify your code.
Style Trace Object
In the component details, there's a trace object under styles:
What it shows:
- Sources that contributed to final styles
- Style priority (later sources override earlier ones)
- Helps debug style conflicts
Example:
trace: {
default: { color: 'black' },
theme: { color: 'blue' },
custom: { color: 'red' } // This wins
}
Filtering Components
React DevTools shows many wrapper components along with WaveMaker components. To focus on WaveMaker components only:
Filter pattern:
^(?!Wm)
This regex filters out all components except those starting with "Wm" (WaveMaker components).
How to apply:
- Click filter icon in Components panel
- Enter pattern:
^(?!Wm) - Press Enter
- Only WaveMaker components are shown
Profiler Panel
The Profiler measures component render performance to identify bottlenecks.
Recording a Profile
- Open ⚛️ Profiler panel
- Click Record button (red circle)
- Interact with your application
- Click Stop to finish recording
Analyzing Results
Flame Graph:
- Shows which components rendered
- Width = render duration
- Color intensity = relative performance
- Hover for detailed timing
Ranked Chart:
- Lists components by render time
- Longest renders at top
- Click to see render details
Component Chart:
- Shows individual component renders over time
- Useful for tracking repeated renders
- Identify unnecessary re-renders
Performance Metrics
For each component render:
- Duration – Time to render
- Commit time – When changes committed to DOM
- Interactions – User interactions during render
Use cases:
- Find slow rendering components
- Identify unnecessary re-renders
- Optimize component performance
- Compare before/after optimization
Key Features
✅ Advantages:
- Shows React components (not HTML elements)
- View and edit props and state in real-time
- Component hierarchy visualization
- Performance profiling for React components
- Works with both web preview and Expo builds
- Trace object shows style source priority
- Free and open source
⚛️ WaveMaker Integration:
- Inspect WaveMaker widget components
- View widget properties as props
- Filter to show only Wm* components
- Debug data binding values
- Trace style conflicts
Best Practices
1. Use Filters Effectively
// ✅ Good - Filter to relevant components
^(?!Wm) // Show only WaveMaker components
UserProfile // Search for specific component
2. Combine with Chrome DevTools
// ✅ Good - Use both together
// React DevTools → Component state/props
// Chrome DevTools → Network/Console/Sources
// ❌ Bad - Using one tool for everything
3. Profile in Production Mode
For accurate performance measurements:
# Build in production mode
npm run build
# Or set NODE_ENV
NODE_ENV=production npm start
4. Clean Up After Profiling
Profiling can impact performance:
- Stop recording when done
- Clear profile data between tests
- Don't leave profiler running continuously
Keyboard Shortcuts
- Select Element – Click component in tree
- Expand/Collapse – Arrow keys
- Search – Start typing component name
- Clear Console – Same as browser DevTools
Troubleshooting
React DevTools Not Showing
If panels don't appear:
- Refresh the page
- Ensure extension is enabled
- Check if React is detected (icon color)
- Try incognito mode
- Reinstall extension
"This page is using the development build of React"
This warning is normal in development mode. Ignore it or build in production mode for testing.
Components Not Updating
If changes don't reflect:
- Check if component uses props/state correctly
- Verify re-render is triggered
- Check for memoization blocking updates
- Use Profiler to see if component rendered
Related Documentation
Other Debugging Tools:
- Chrome DevTools – Browser debugging for web preview
- React Native DevTools – React Native debugging
- WavePulse – WaveMaker debugging tool
Testing Documentation:
- Debugging Overview – All debugging tools and methods
- UI Testing Mobile – Mobile testing strategies
External Resources:
- React DevTools Documentation – Official guide
- React DevTools GitHub – Source code
- Profiling Components – Profiling API
React DevTools works with any React or React Native application, not just WaveMaker apps. It's a valuable tool for any React developer.