File tree Expand file tree Collapse file tree 4 files changed +15
-12
lines changed
packages/devtools-utils/src Expand file tree Collapse file tree 4 files changed +15
-12
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @tanstack/devtools-utils ' : patch
3+ ---
4+
5+ fix issues with mounting
Original file line number Diff line number Diff line change @@ -41,7 +41,9 @@ export function createReactPanel<
4141 }
4242
4343 return ( ) => {
44- devtools . current ?. unmount ( )
44+ if ( devToolRef . current ) {
45+ devtools . current ?. unmount ( )
46+ }
4547 }
4648 } , [ props ?. theme ] )
4749
Original file line number Diff line number Diff line change @@ -28,8 +28,7 @@ export function constructCoreClass(Component: () => JSX.Element) {
2828 }
2929 const mountTo = el
3030 const dispose = render ( ( ) => {
31- // eslint-disable-next-line @typescript-eslint/require-await
32- this . #Component = lazy ( async ( ) => ( { default : Component } ) )
31+ this . #Component = Component
3332
3433 this . #ThemeProvider = lazy ( ( ) =>
3534 import ( '@tanstack/devtools-ui' ) . then ( ( mod ) => ( {
Original file line number Diff line number Diff line change 11/** @jsxImportSource solid-js - we use Solid.js as JSX here */
22
3- import { onCleanup , onMount } from 'solid-js'
3+ import { createSignal , onCleanup , onMount } from 'solid-js'
44import type { ClassType } from './class'
55
66export interface DevtoolsPanelProps {
@@ -12,17 +12,14 @@ export function createSolidPanel<
1212> ( CoreClass : ClassType ) {
1313 function Panel ( props : TComponentProps ) {
1414 let devToolRef : HTMLDivElement | undefined
15-
15+ const [ devtools ] = createSignal ( new CoreClass ( ) )
1616 onMount ( ( ) => {
17- const devtools = new CoreClass ( )
18-
1917 if ( devToolRef ) {
20- devtools . mount ( devToolRef , props ?. theme ?? 'dark' )
21-
22- onCleanup ( ( ) => {
23- devtools . unmount ( )
24- } )
18+ devtools ( ) . mount ( devToolRef , props ?. theme ?? 'dark' )
2519 }
20+ onCleanup ( ( ) => {
21+ devtools ( ) . unmount ( )
22+ } )
2623 } )
2724
2825 return < div style = { { height : '100%' } } ref = { devToolRef } />
You can’t perform that action at this time.
0 commit comments