Skip to content

Commit 4c00a11

Browse files
committed
fixup for the panel classes
1 parent c1e6cc8 commit 4c00a11

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

.changeset/neat-peaches-matter.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/devtools-utils': patch
3+
---
4+
5+
fix: panel issue fix

packages/devtools-utils/src/preact/panel.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ export function createPreactPanel<
3434
const devToolRef = useRef<HTMLDivElement>(null)
3535
const devtools = useRef<TCoreDevtoolsClass | null>(null)
3636
useEffect(() => {
37-
if (devtools.current) return
38-
3937
devtools.current = new CoreClass()
4038

4139
if (devToolRef.current) {
@@ -44,7 +42,8 @@ export function createPreactPanel<
4442

4543
return () => {
4644
if (devToolRef.current) {
47-
devtools.current?.unmount()
45+
devtools.current?.unmount();
46+
devtools.current = null;
4847
}
4948
}
5049
}, [props?.theme])

packages/devtools-utils/src/react/panel.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ export function createReactPanel<
3232
const devToolRef = useRef<HTMLDivElement>(null)
3333
const devtools = useRef<TCoreDevtoolsClass | null>(null)
3434
useEffect(() => {
35-
if (devtools.current) return
36-
3735
devtools.current = new CoreClass()
3836

3937
if (devToolRef.current) {
@@ -42,7 +40,8 @@ export function createReactPanel<
4240

4341
return () => {
4442
if (devToolRef.current) {
45-
devtools.current?.unmount()
43+
devtools.current?.unmount();
44+
devtools.current = null;
4645
}
4746
}
4847
}, [props?.theme])

0 commit comments

Comments
 (0)