refactor(web): organize devtools components (#30318)

This commit is contained in:
yyh
2025-12-30 09:21:41 +08:00
committed by GitHub
parent 43758ec85d
commit 673209d086
6 changed files with 46 additions and 15 deletions

View File

@ -0,0 +1,21 @@
'use client'
import { lazy, Suspense } from 'react'
import { IS_DEV } from '@/config'
const ReactScan = lazy(() =>
import('./scan').then(module => ({
default: module.ReactScan,
})),
)
export const ReactScanLoader = () => {
if (!IS_DEV)
return null
return (
<Suspense fallback={null}>
<ReactScan />
</Suspense>
)
}

View File

@ -0,0 +1,21 @@
'use client'
import { lazy, Suspense } from 'react'
import { IS_DEV } from '@/config'
const TanStackDevtoolsWrapper = lazy(() =>
import('./devtools').then(module => ({
default: module.TanStackDevtoolsWrapper,
})),
)
export const TanStackDevtoolsLoader = () => {
if (!IS_DEV)
return null
return (
<Suspense fallback={null}>
<TanStackDevtoolsWrapper />
</Suspense>
)
}