(el: T, theme: 'light' | 'dark')
| 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) { |
no outgoing calls
no test coverage detected