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

Method mount

packages/devtools-utils/src/solid/class.ts:26–51  ·  view source on GitHub ↗
(
      el: T,
      props: TanStackDevtoolsPluginProps,
    )

Source from the content-addressed store, hash-verified

24 constructor() {}
25
26 async mount<T extends HTMLElement>(
27 el: T,
28 props: TanStackDevtoolsPluginProps,
29 ) {
30 if (this.#isMounted || this.#isMounting) {
31 throw new Error('Devtools is already mounted')
32 }
33 this.#isMounting = true
34 this.#abortMount = false
35
36 try {
37 const { __mountComponent } = await import('./class-mount-impl')
38 // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- can be set by unmount() during await
39 if (this.#abortMount) {
40 this.#isMounting = false
41 return
42 }
43
44 this.#dispose = __mountComponent(el, props, importFn)
45 this.#isMounted = true
46 this.#isMounting = false
47 } catch (err) {
48 this.#isMounting = false
49 console.error('[TanStack Devtools] Failed to load:', err)
50 }
51 }
52
53 unmount() {
54 if (!this.#isMounted && !this.#isMounting) {

Callers 7

PanelFunction · 0.45
mountFunction · 0.45
PanelFunction · 0.45
class.test.tsxFile · 0.45
PanelFunction · 0.45
createSveltePanelFunction · 0.45
setupFunction · 0.45

Calls 1

__mountComponentFunction · 0.85

Tested by

no test coverage detected