diff --git a/.changeset/thin-pianos-rhyme.md b/.changeset/thin-pianos-rhyme.md new file mode 100644 index 00000000..2e9e0d70 --- /dev/null +++ b/.changeset/thin-pianos-rhyme.md @@ -0,0 +1,5 @@ +--- +'@tanstack/devtools-utils': patch +--- + +revert panel generation diff --git a/packages/devtools-utils/src/react/panel.tsx b/packages/devtools-utils/src/react/panel.tsx index cfc82f79..274ff8b3 100644 --- a/packages/devtools-utils/src/react/panel.tsx +++ b/packages/devtools-utils/src/react/panel.tsx @@ -32,16 +32,18 @@ export function createReactPanel< const devToolRef = useRef(null) const devtools = useRef(null) useEffect(() => { - const instance = new CoreClass() - devtools.current = instance + if (devtools.current) return + + devtools.current = new CoreClass() if (devToolRef.current) { - instance.mount(devToolRef.current, props?.theme ?? 'dark') + devtools.current.mount(devToolRef.current, props?.theme ?? 'dark') } return () => { - instance.unmount() - devtools.current = null + if (devToolRef.current) { + devtools.current?.unmount() + } } }, [props?.theme])