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<
41
41
}
42
42
43
43
return ( ) => {
44
- devtools . current ?. unmount ( )
44
+ if ( devToolRef . current ) {
45
+ devtools . current ?. unmount ( )
46
+ }
45
47
}
46
48
} , [ props ?. theme ] )
47
49
Original file line number Diff line number Diff line change @@ -28,8 +28,7 @@ export function constructCoreClass(Component: () => JSX.Element) {
28
28
}
29
29
const mountTo = el
30
30
const dispose = render ( ( ) => {
31
- // eslint-disable-next-line @typescript-eslint/require-await
32
- this . #Component = lazy ( async ( ) => ( { default : Component } ) )
31
+ this . #Component = Component
33
32
34
33
this . #ThemeProvider = lazy ( ( ) =>
35
34
import ( '@tanstack/devtools-ui' ) . then ( ( mod ) => ( {
Original file line number Diff line number Diff line change 1
1
/** @jsxImportSource solid-js - we use Solid.js as JSX here */
2
2
3
- import { onCleanup , onMount } from 'solid-js'
3
+ import { createSignal , onCleanup , onMount } from 'solid-js'
4
4
import type { ClassType } from './class'
5
5
6
6
export interface DevtoolsPanelProps {
@@ -12,17 +12,14 @@ export function createSolidPanel<
12
12
> ( CoreClass : ClassType ) {
13
13
function Panel ( props : TComponentProps ) {
14
14
let devToolRef : HTMLDivElement | undefined
15
-
15
+ const [ devtools ] = createSignal ( new CoreClass ( ) )
16
16
onMount ( ( ) => {
17
- const devtools = new CoreClass ( )
18
-
19
17
if ( devToolRef ) {
20
- devtools . mount ( devToolRef , props ?. theme ?? 'dark' )
21
-
22
- onCleanup ( ( ) => {
23
- devtools . unmount ( )
24
- } )
18
+ devtools ( ) . mount ( devToolRef , props ?. theme ?? 'dark' )
25
19
}
20
+ onCleanup ( ( ) => {
21
+ devtools ( ) . unmount ( )
22
+ } )
26
23
} )
27
24
28
25
return < div style = { { height : '100%' } } ref = { devToolRef } />
You can’t perform that action at this time.
0 commit comments