MCPcopy Create free account
hub / github.com/TanStack/devtools / mountDevtools

Function mountDevtools

packages/devtools/src/mount-impl.tsx:27–53  ·  view source on GitHub ↗
(options: MountOptions)

Source from the content-addressed store, hash-verified

25 eventBus: { stop: () => void }
26}
27
28export function mountDevtools(options: MountOptions): MountResult {
29 const { el, plugins, config, eventBusConfig, onSetPlugins } = options
30
31 const eventBus = new ClientEventBus(eventBusConfig)
32 eventBus.start()
33
34 // Loaded by hand rather than with `lazy`, which would need a `Loading`
35 // boundary to keep the root from waiting on the chunk.
36 const [devtools, setDevtools] = createSignal<Component>()
37 void import('./devtools').then((mod) => setDevtools(() => mod.default))
38
39 const dispose = render(
40 () => (
41 <DevtoolsProvider
42 plugins={plugins}
43 config={config}
44 onSetPlugins={onSetPlugins}
45 >
46 <PiPProvider>
47 <Portal mount={el}>
48 {/* Set once, when the chunk arrives. */}
49 <Show when={devtools()} keyed>
50 {(Shell) => createComponent(Shell, {})}
51 </Show>
52 </Portal>
53 </PiPProvider>
54 </DevtoolsProvider>
55 ),
56 el,

Callers 1

mountMethod · 0.85

Calls 1

startMethod · 0.95

Tested by

no test coverage detected