Skip to content

Commit

Permalink
feat: remove tanstack devtools in prod
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher2K committed Nov 7, 2024
1 parent 29c7afb commit c53b6d1
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions swapify_web/src/router.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { lazy, Suspense } from "react";
import {
Outlet,
createRootRoute,
createRoute,
createRouter,
} from "@tanstack/react-router";
import { TanStackRouterDevtools } from "@tanstack/router-devtools";
import { z } from "zod";

import { AppScreenLayout } from "#root/components/app-screen-layout";
Expand All @@ -21,11 +21,21 @@ import { PlaylistsPage } from "#root/features/playlists/playlists-page";
import { Root } from "#root/root";
import { TransfersPage } from "#root/features/transfers/transfers-page";

const TanStackRouterDevtools = import.meta.env.DEV
? lazy(() =>
import("@tanstack/router-devtools").then((res) => ({
default: res.TanStackRouterDevtools,
})),
)
: () => null;

const rootRoute = createRootRoute({
component: () => (
<Root>
<Outlet />
<TanStackRouterDevtools />
<Suspense>
<TanStackRouterDevtools />
</Suspense>
</Root>
),
});
Expand Down

0 comments on commit c53b6d1

Please sign in to comment.