Skip to content

Commit 0c2bf1e

Browse files
authored
fix(vue-query-devtools): only register cleanup after mount (#10439)
* fix(vue-query-devtools): only register cleanup after mount * chore(changeset): add vue-query-devtools patch release note
1 parent 3f56a86 commit 0c2bf1e

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

.changeset/khaki-coats-divide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/vue-query-devtools': patch
3+
---
4+
5+
Fix Vue SSR devtools cleanup by only registering `unmount()` after `mount()` has run.

packages/vue-query-devtools/src/devtools.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ watchEffect(() => {
3333
3434
onMounted(() => {
3535
devtools.mount(div.value as HTMLElement)
36-
})
37-
38-
onScopeDispose(() => {
39-
devtools.unmount()
36+
onScopeDispose(() => {
37+
devtools.unmount()
38+
})
4039
})
4140
</script>
4241

packages/vue-query-devtools/src/devtoolsPanel.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@ watchEffect(() => {
3838
3939
onMounted(() => {
4040
devtools.mount(div.value as HTMLElement)
41-
})
42-
43-
onScopeDispose(() => {
44-
devtools.unmount()
41+
onScopeDispose(() => {
42+
devtools.unmount()
43+
})
4544
})
4645
</script>
4746

0 commit comments

Comments
 (0)