Installation
Install the DevTools package:Basic setup
Add DevTools to your root route:src/routes/__root.tsx
DevTools are automatically excluded from production builds, so you can safely include them in your code.
Position options
Control where the DevTools panel appears:Features
Router explorer
Inspect your router’s current state:- Location - Current pathname, search params, and hash
- Matches - Active route matches with params and data
- Pending - Routes being navigated to
- Cached - Cached loader data
Route inspector
View detailed information about each route:- Route ID and path
- Path parameters
- Search parameters
- Loader data
- Route context
- Match status
Navigation timeline
Track navigation events:- Navigation start/end times
- Loader execution duration
- Data fetch timings
- Transition states
Cache inspector
Monitor loader cache:- Cached route data
- Cache timestamps
- Stale/fresh status
- Manual cache invalidation
Development-only features
DevTools include helpful dev-only features:Custom styling
Style the DevTools panel:Toggle DevTools
Control visibility programmatically:Environment-based setup
Only load DevTools in development:Debugging techniques
Inspect navigation
Use DevTools to debug navigation issues:- Open DevTools panel
- Navigate to a route
- Check the “Pending” section for loading states
- Inspect “Matches” for active route data
- View “Timeline” for performance issues
Debug loader data
Inspect what data loaders return:- Navigate to route with loader
- Open “Route Inspector”
- View “Loader Data” section
- Check data structure and values
Monitor cache behavior
Understand cache hits and misses:- Open “Cache Inspector”
- Navigate between routes
- Watch cache entries being created/reused
- Check stale times and expiration
Integration with other DevTools
React DevTools
Use both together:Browser DevTools
Access router state from console:Performance profiling
Identify performance bottlenecks:- Open DevTools timeline
- Perform navigation
- Check loader execution times
- Identify slow data fetches
- Optimize slow loaders
Common debugging scenarios
Route not matching
- Check route path in DevTools explorer
- Verify params are correct
- Inspect route tree structure
- Check for path conflicts
Loader not running
- Open Route Inspector
- Check if loader is defined
- Verify loaderDeps configuration
- Check cache status
Data not updating
- Check cache inspector
- Verify staleTime settings
- Manually invalidate cache
- Check loaderDeps dependencies
Best practices
Keep DevTools installed
Keep DevTools installed
DevTools are tree-shaken in production, so there’s no cost to keeping them in your code.
Use DevTools for learning
Use DevTools for learning
Explore the DevTools UI to understand how the router works internally.
Profile before optimizing
Profile before optimizing
Use the timeline to identify actual performance issues before optimizing.
Inspect route state
Inspect route state
Use the route inspector to understand what data is available to your components.
Keyboard shortcuts
Toggle panel: Click the floating button or use your custom toggle
Production builds
Next steps
Router state
Learn about router state hooks
Data loading
Debug data loading issues