File tree Expand file tree Collapse file tree
packages/devtools-utils/src/react Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ ' @tanstack/devtools-utils ' : patch
3+ ---
4+
5+ fix issue with unmounting of devtools
Original file line number Diff line number Diff line change @@ -32,18 +32,16 @@ export function createReactPanel<
3232 const devToolRef = useRef < HTMLDivElement > ( null )
3333 const devtools = useRef < TCoreDevtoolsClass | null > ( null )
3434 useEffect ( ( ) => {
35- if ( devtools . current ) return
36-
37- devtools . current = new CoreClass ( )
35+ const instance = new CoreClass ( )
36+ devtools . current = instance
3837
3938 if ( devToolRef . current ) {
40- devtools . current . mount ( devToolRef . current , props ?. theme ?? 'dark' )
39+ instance . mount ( devToolRef . current , props ?. theme ?? 'dark' )
4140 }
4241
4342 return ( ) => {
44- if ( devToolRef . current ) {
45- devtools . current ?. unmount ( )
46- }
43+ instance . unmount ( )
44+ devtools . current = null
4745 }
4846 } , [ props ?. theme ] )
4947
You can’t perform that action at this time.
0 commit comments