File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,21 +3,32 @@ import React, { Suspense } from "react"
33
44import NotFound from "../components/Common/NotFound"
55
6- const TanStackRouterDevtools =
6+ const loadDevtools = ( ) =>
7+ Promise . all ( [
8+ import ( "@tanstack/router-devtools" ) ,
9+ import ( "@tanstack/react-query-devtools" )
10+ ] ) . then ( ( [ routerDevtools , reactQueryDevtools ] ) => {
11+ return {
12+ default : ( ) => (
13+ < >
14+ < routerDevtools . TanStackRouterDevtools />
15+ < reactQueryDevtools . ReactQueryDevtools />
16+ </ >
17+ )
18+ } ;
19+ } ) ;
20+
21+ const TanStackDevtools =
722 process . env . NODE_ENV === "production"
823 ? ( ) => null
9- : React . lazy ( ( ) =>
10- import ( "@tanstack/router-devtools" ) . then ( ( res ) => ( {
11- default : res . TanStackRouterDevtools ,
12- } ) ) ,
13- )
24+ : React . lazy ( loadDevtools ) ;
1425
1526export const Route = createRootRoute ( {
1627 component : ( ) => (
1728 < >
1829 < Outlet />
1930 < Suspense >
20- < TanStackRouterDevtools />
31+ < TanStackDevtools />
2132 </ Suspense >
2233 </ >
2334 ) ,
You can’t perform that action at this time.
0 commit comments