summaryrefslogtreecommitdiff
path: root/packages/integrations/svelte/client-v5.js
diff options
context:
space:
mode:
authorGravatar Martin Trapp <94928215+martrapp@users.noreply.github.com> 2024-10-05 13:16:14 +0200
committerGravatar GitHub <noreply@github.com> 2024-10-05 13:16:14 +0200
commit5bc6223b1200baba9679a4dafea79c73486c275d (patch)
tree64f0db7e4820fa528e134bb6a1bee143db98913f /packages/integrations/svelte/client-v5.js
parent6e1dfeb76bec09d24928bab798c6ad3280f42e84 (diff)
downloadastro-5bc6223b1200baba9679a4dafea79c73486c275d.tar.gz
astro-5bc6223b1200baba9679a4dafea79c73486c275d.tar.zst
astro-5bc6223b1200baba9679a4dafea79c73486c275d.zip
Fix-component-undefined-svelte-v5 (#12102) (#12129)
* - fix: 'component is not defined' error when unmount svelte 5 component * added changeset * Moving unmount listener to where the component is defined. * Update .changeset/eighty-ligers-punch.md --------- Co-authored-by: Hermit <70563349+hermit99@users.noreply.github.com>
Diffstat (limited to '')
-rw-r--r--packages/integrations/svelte/client-v5.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/packages/integrations/svelte/client-v5.js b/packages/integrations/svelte/client-v5.js
index 78bab3ea3..7a046b5bf 100644
--- a/packages/integrations/svelte/client-v5.js
+++ b/packages/integrations/svelte/client-v5.js
@@ -39,8 +39,7 @@ export default (element) => {
},
});
existingApplications.set(element, component);
+ element.addEventListener('astro:unmount', () => unmount(component), { once: true });
}
-
- element.addEventListener('astro:unmount', () => unmount(component), { once: true });
};
};