diff --git a/src/routes/__root.tsx b/src/routes/__root.tsx index 3b48f87..c9f3b8a 100644 --- a/src/routes/__root.tsx +++ b/src/routes/__root.tsx @@ -1,17 +1,16 @@ import { createRootRoute, Outlet } from "@tanstack/react-router"; import React from "react"; -const TanStackRouterDevtools = - process.env.NODE_ENV === "production" - ? () => null // Render nothing in production - : React.lazy(() => - // Lazy load in development - import("@tanstack/router-devtools").then((res) => ({ - default: res.TanStackRouterDevtools, - // For Embedded Mode - // default: res.TanStackRouterDevtoolsPanel - })) - ); +const TanStackRouterDevtools = import.meta.env.PROD + ? () => null // Render nothing in production + : React.lazy(() => + // Lazy load in development + import("@tanstack/router-devtools").then((res) => ({ + default: res.TanStackRouterDevtools, + // For Embedded Mode + // default: res.TanStackRouterDevtoolsPanel + })) + ); export const Route = createRootRoute({ component: () => {