Skip to content

Commit e7f2877

Browse files
chore: fix panel double mounting (#310)
* chore: fix panel double mounting * changeset * ci: apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 98228a1 commit e7f2877

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

.changeset/rare-rats-tease.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 double mounting of panels

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export function createPreactPanel<
3434
const devToolRef = useRef<HTMLDivElement>(null)
3535
const devtools = useRef<TCoreDevtoolsClass | null>(null)
3636
useEffect(() => {
37+
if (devtools.current) return
3738
devtools.current = new CoreClass()
3839

3940
if (devToolRef.current) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export function createReactPanel<
3232
const devToolRef = useRef<HTMLDivElement>(null)
3333
const devtools = useRef<TCoreDevtoolsClass | null>(null)
3434
useEffect(() => {
35+
if (devtools.current) return
3536
devtools.current = new CoreClass()
3637

3738
if (devToolRef.current) {

0 commit comments

Comments
 (0)