diff --git a/.changeset/khaki-points-end.md b/.changeset/khaki-points-end.md new file mode 100644 index 00000000..13311d60 --- /dev/null +++ b/.changeset/khaki-points-end.md @@ -0,0 +1,5 @@ +--- +'@tanstack/devtools-utils': patch +--- + +Removes additional portal allowing children to grow to 100% diff --git a/packages/devtools-utils/src/solid/class.tsx b/packages/devtools-utils/src/solid/class.tsx index 7cbb94ae..2aca21f5 100644 --- a/packages/devtools-utils/src/solid/class.tsx +++ b/packages/devtools-utils/src/solid/class.tsx @@ -25,10 +25,12 @@ export function constructCoreClass(Component: () => JSX.Element) { async mount(el: T, theme: 'light' | 'dark') { this.#isMounting = true const { lazy } = await import('solid-js') - const { render, Portal } = await import('solid-js/web') + const { render } = await import('solid-js/web') + if (this.#isMounted) { throw new Error('Devtools is already mounted') } + const mountTo = el const dispose = render(() => { this.#Component = Component @@ -38,22 +40,21 @@ export function constructCoreClass(Component: () => JSX.Element) { default: mod.ThemeContextProvider, })), ) + const Devtools = this.#Component const ThemeProvider = this.#ThemeProvider return ( - -
- - - -
-
+ + + ) }, mountTo) + this.#isMounted = true this.#isMounting = false this.#dispose = dispose + if (this.#mountCb) { this.#mountCb() this.#mountCb = null @@ -64,6 +65,7 @@ export function constructCoreClass(Component: () => JSX.Element) { if (!this.#isMounted && !this.#isMounting) { throw new Error('Devtools is not mounted') } + if (this.#isMounting) { this.#mountCb = () => { this.#dispose?.() @@ -71,17 +73,21 @@ export function constructCoreClass(Component: () => JSX.Element) { } return } + this.#dispose?.() this.#isMounted = false } } + class NoOpDevtoolsCore extends DevtoolsCore { constructor() { super() } + async mount(_el: T, _theme: 'light' | 'dark') {} unmount() {} } + return [DevtoolsCore, NoOpDevtoolsCore] as const }