fix: don't show tanstack dev tool in prod

This commit is contained in:
2024-12-02 23:17:02 +00:00
parent 0c2ceb3bd0
commit 6b955ded73

View File

@@ -1,5 +1,17 @@
import {Outlet} from "@tanstack/react-router";
import {TanStackRouterDevtools} from "@tanstack/router-devtools";
import { 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
})),
);
function App() {
return (