Capítulo 3 de 57
TanStack Router ships dedicated devtools, installed as a separate package, that visualize the router's internal state; they can be rendered in Floating, Fixed, or Embedded mode, and are excluded from production builds unless the explicit *InProd variant is used.
@tanstack/react-router-devtools: The separate package to install (Solid: @tanstack/solid-router-devtools).TanStackRouterDevtools: The default import; automatically hidden when process.env.NODE_ENV === 'production'.TanStackRouterDevtoolsInProd: Same API as TanStackRouterDevtools but renders even in production environments.localStorage across reloads.TanStackRouterDevtoolsPanel directly, allowing attachment to a specific Shadow DOM target for custom positioning.TanStackRouterDevtoolsPanel as a normal component that can be styled freely via style/className (Solid: class).router prop matching the instance passed to RouterProvider, allowing placement anywhere on the page, not just inside the provider.// src/routes/__root.tsx
import { createRootRoute, Outlet } from '@tanstack/react-router'
import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'
export const Route = createRootRoute({
component: () => (
<>
<Outlet />
<TanStackRouterDevtools />
</>
),
})
function App() {
return (
<>
<RouterProvider router={router} />
<TanStackRouterDevtools initialIsOpen={false} />
</>
)
}
initialIsOpen controlling default visibility.TanStackRouterDevtools for automatic prod-exclusion; use TanStackRouterDevtoolsInProd only when devtools are intentionally needed in production.position, panelProps, shadowDOMTarget, and containerElement allow fine control over placement and styling without forking the component.TanStackRouterDevtoolsPanel (Fixed/Embedded modes) when the floating toggle UX is not desired, e.g. to embed devtools inside a custom debug layout.