Reactotron is a powerful debugging tool integrated into the MindLogger Mobile app for development purposes. It provides real-time visibility into:
- Redux State & Actions: Track all Redux actions and state changes
- MMKV Storage: Monitor all storage read/write operations across all instances
- Network Requests: View complete HTTP request/response data
- Errors & Warnings: See errors and warnings with on-screen overlay
- Performance Metrics: Track request timing and app performance
Important: Reactotron is only enabled in dev builds (
ENV=dev) for security and performance reasons.
Download and install the Reactotron desktop application:
| Platform | Download Link |
|---|---|
| macOS | GitHub Releases |
| Windows | GitHub Releases |
| Linux | GitHub Releases |
Or install via Homebrew on macOS:
brew install --cask reactotronNo additional configuration needed. Reactotron will connect automatically.
Run the following command to forward the Reactotron port:
adb reverse tcp:9090 tcp:9090Update the Reactotron configuration to use your computer's IP address:
File: src/shared/config/reactotron.config.ts
reactotron = Reactotron.configure({
name: 'MindLogger Mobile',
host: '192.168.1.XXX', // Replace with your computer's IP
})Find your computer's IP:
- macOS: System Preferences → Network
- Windows: Run
ipconfigin Command Prompt- Linux: Run
ip addrorifconfig
-
Start Reactotron Desktop App
- Launch Reactotron before running the app
- Leave it running in the background
-
Run Dev Build
# iOS
yarn ios:dev
# Android
yarn android:dev- Verify Connection
- You should see "MindLogger Mobile" appear in Reactotron
- Console will log:
[Reactotron] Connected successfully
Shows a chronological view of all events:
- Redux actions
- Network requests
- Storage operations
- Custom logs
- Errors and warnings
Filtering: Use the search bar to filter events by type or content.
Displays the current Redux state tree:
- Navigate through state structure
- Search for specific state keys
- View state values in real-time
- Subscribe to specific state slices
Snapshots: Click "Snapshot" to save current state for comparison.
View all dispatched Redux actions:
- Action type and payload
- State before and after
- Time and duration
- Stack trace (if applicable)
Dispatching Actions: Use the "Dispatch" feature to manually trigger Redux actions for testing.
Monitor all network requests:
- Request method, URL, headers, body
- Response status, headers, body
- Request timing and duration
- Error details for failed requests
Features:
- Click any request to see full details
- Authorization headers are filtered (shows "Bearer ***")
- Failed requests highlighted in red
Track all MMKV storage operations:
- All registered storage instances
- Read/write operations
- Current storage values
- Storage keys and their data
Tracked Instances:
redux-storage- Redux persist storagelocalization-storage- Language/translation data- Any dynamically created storage instances
Sensitive Data: Some keys are filtered (tokens, passwords, encryption keys).
Use Reactotron logging in your code:
import Reactotron from '@shared/config/reactotron.config';
// Standard log
Reactotron.log?.('Debug message');
// Important log (highlighted)
Reactotron.logImportant?.('Critical information');
// Warning
Reactotron.warn?.('Warning message');
// Error
Reactotron.error?.('Error details');
// Custom display
Reactotron.display?.({
name: 'Custom Event',
preview: 'Preview text',
value: { any: 'data' },
important: true,
});Reactotron is automatically disabled in non-dev environments. The configuration checks:
if (Config.ENV === 'dev') {
// Reactotron enabled
} else {
// No-op implementation
}| Build Variant | Reactotron Enabled? |
|---|---|
| ✅ dev | Yes |
| ❌ qa | No |
| ❌ staging | No |
| ❌ uat | No |
| ❌ production | No |
The following data is automatically filtered from Reactotron logs:
| Category | Filtered Data |
|---|---|
| Network Requests | Authorization headers → "Bearer ***" |
| MMKV Storage | STORE_ENCRYPTION_KEY, accessToken, refreshToken, password, secret |
Edit src/shared/config/reactotron.config.ts to customize:
Overlay Settings:
.useReactNative({
overlay: true, // Show error overlay
errors: {
veto: () => false, // Show all errors (or filter)
},
})Network Filtering:
networking: {
ignoreUrls: /symbolicate|logs|inspector|YOUR_PATTERN/,
}Storage Filtering:
Edit src/shared/lib/storages/ReactotronMMKVTracker.ts:
ignore: [
'STORE_ENCRYPTION_KEY',
'accessToken',
'YOUR_SENSITIVE_KEY',
],Problem: App runs but Reactotron doesn't show connection.
Solutions:
- Verify Reactotron desktop app is running.
- Check that you're running a dev build (
yarn ios:dev/yarn android:dev). - For Android emulator, run:
adb reverse tcp:9090 tcp:9090. - For physical devices, verify IP address in config matches your computer.
- Check firewall settings (allow port 9090).
- Restart both the app and Reactotron desktop.
Problem: Timeline shows Redux actions but not network requests.
Solutions:
- Verify network tracking job is loaded (check console for:
[Reactotron] Network tracking configured). - Ensure requests are going through
httpServiceinstance. - Check that requests aren't being filtered by
ignoreUrlspattern. - Look in Timeline tab, not just API tab.
Problem: State tab shows stale data.
Solutions:
- Click the refresh icon in State tab.
- Verify Redux enhancer is loaded (check Redux tab for actions).
- Restart the app.
- Check that
Config.ENV === 'dev'.
Problem: MMKV operations not showing in Reactotron.
Solutions:
- Verify storage instances are being registered (check console logs).
- Check that operations aren't filtered by
ignorelist. - Ensure storage is created via
createStorage()functions (not direct MMKV instantiation). - Restart app after configuration changes.
Problem: App feels slow with Reactotron connected.
Solutions:
- Disable overlay if not needed:
overlay: false. - Filter noisy network requests via
ignoreUrls. - Reduce Redux action logging (filter in Reactotron UI).
- Use Reactotron sparingly during performance testing.
Problem: Cannot connect, port conflict.
Solutions:
-
Find process using port:
- macOS/Linux:
lsof -i :9090 - Windows:
netstat -ano | findstr :9090
- macOS/Linux:
-
Kill the process or change Reactotron port in config:
Reactotron.configure({
port: 9091, // Use different port
})- Start Reactotron first before launching the app.
- Clear timeline at the start of each debugging session.
- Use snapshots to compare state at different points.
- Filter events to focus on relevant information.
- Take screenshots of interesting timelines for documentation.
| Area | Tips |
|---|---|
| Redux Issues | Watch Timeline for unexpected actions; compare state snapshots; dispatch test actions. |
| Network Issues | Check request timing; verify headers; examine response bodies; track failed requests. |
| Storage Issues | Monitor writes; check for unexpected keys; verify JSON serialization; track instances. |
| Performance | Measure request duration; identify slow reducers; track storage frequency; monitor memory usage. |
When to Log:
// ✅ Good: Important state transitions
Reactotron.logImportant?.('User logged in:', userId);
// ✅ Good: Debugging complex logic
Reactotron.display?.({
name: 'Calculation Result',
value: { input, output, intermediate },
});
// ❌ Bad: Excessive logging in loops
array.forEach(item => {
Reactotron.log?.(item); // Don't do this
});
// ✅ Better: Summarize
Reactotron.log?.(`Processed ${array.length} items`);Performance Considerations:
- Keep logging concise.
- Avoid logging large objects in hot paths.
- Use conditional logging for verbose output.
- Remember: Reactotron is only active in dev.
| File | Purpose |
|---|---|
index.js |
Import Reactotron first to ensure connection before Redux/MMKV initialization |
src/shared/config/reactotron.config.ts |
Main configuration and plugin setup (Redux, MMKV, networking), environment gating |
src/app/ui/AppProvider/ReduxProvider.tsx |
Redux store enhancer integration for action/state tracking |
src/shared/lib/storages/createStorage.ts |
MMKV instance registration and automatic tracking |
src/jobs/reactotron-network-tracking.ts |
Axios interceptor setup for request/response logging |
App Start
→ Reactotron Config Loaded (index.js)
→ Reactotron Connects to Desktop
→ MMKV Instances Registered (as created)
→ Redux Store Created (with enhancer)
→ Network Tracking Job Runs (axios interceptors)
→ App Ready (all tracking active)
If you encounter issues with Reactotron integration:
- Check this documentation first.
- Review console logs for Reactotron-related messages.
- Verify environment configuration (
Config.ENV). - Check Reactotron GitHub issues for known problems.
- Contact the development team for assistance.