fix(devtools-utils): unmount the devtools core when a Preact or React panel unmounts by JoviDeCroock · Pull Request #533 · TanStack/devtools · GitHub
Skip to content

fix(devtools-utils): unmount the devtools core when a Preact or React panel unmounts - #533

Open
JoviDeCroock wants to merge 1 commit into
TanStack:mainfrom
JoviDeCroock:fix-panel-unmount-cleanup
Open

JoviDeCroock wants to merge 1 commit into
TanStack:mainfrom
JoviDeCroock:fix-panel-unmount-cleanup

Conversation

@JoviDeCroock

@JoviDeCroock JoviDeCroock commented Sep 28, 2026 •

Copy link
Copy Markdown

🎯 Changes

When a Preact or React panel unmounts, its ref is already detached by the time the effect cleanup runs (React 19, Preact 11), so the devtools core was never unmounted. The effect now keeps the element it mounted into in a variable and uses that in the cleanup. Adds a test for the Preact panel.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm test:pr, or these tests do not apply to this pull request.
  • I fully understand the code in this pull request, including any code generated with AI assistance.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Bug Fixes
    • Devtools panels now reliably unmount and clean up their instances when removed in React and Preact.

@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant