MCPcopy
hub / github.com/TanStack/form / mount

Method mount

packages/form-devtools/src/core.tsx:14–36  ·  view source on GitHub ↗
(el: T, theme: 'light' | 'dark')

Source from the content-addressed store, hash-verified

12 constructor(_init?: FormDevtoolsInit | undefined) {}
13
14 mount<T extends HTMLElement>(el: T, theme: 'light' | 'dark') {
15 if (this.#isMounted) {
16 throw new Error('Devtools is already mounted')
17 }
18
19 this.#ThemeProvider = lazy(() =>
20 import('@tanstack/devtools-ui').then((mod) => ({
21 default: mod.ThemeContextProvider,
22 })),
23 )
24 const ThemeProvider = this.#ThemeProvider
25
26 const dispose = render(() => {
27 return (
28 <ThemeProvider theme={theme}>
29 <Devtools />
30 </ThemeProvider>
31 )
32 }, el)
33
34 this.#isMounted = true
35 this.#dispose = dispose
36 }
37
38 unmount() {
39 if (!this.#isMounted) {

Callers 15

constructorMethod · 0.45
createFieldFunction · 0.45
FieldGroupApiClass · 0.45
FormApiClass · 0.45
FieldApiClass · 0.45
FormApi.test-d.tsFile · 0.45
FieldApi.test-d.tsFile · 0.45
FormApi.spec.tsFile · 0.45
FieldApi.spec.tsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected