summaryrefslogtreecommitdiff
path: root/packages/integrations/svelte/client.svelte.js
diff options
context:
space:
mode:
authorGravatar Matt Kane <m@mk.gg> 2025-03-20 11:43:04 +0000
committerGravatar GitHub <noreply@github.com> 2025-03-20 11:43:04 +0000
commitecadb6b02e942feccf584547fe9c14d3d1e21ba6 (patch)
tree100d7bfc923e53b726c20daf050fd9720a2c306b /packages/integrations/svelte/client.svelte.js
parent62595a00c6d8a24f587abce6a9c7cff6e9f1da68 (diff)
downloadastro-ecadb6b02e942feccf584547fe9c14d3d1e21ba6.tar.gz
astro-ecadb6b02e942feccf584547fe9c14d3d1e21ba6.tar.zst
astro-ecadb6b02e942feccf584547fe9c14d3d1e21ba6.zip
fix(preact,svelte): empty target container before rendering `client:only` island (#13470)
* fix(preact,svelte): empty target container before rendering `client:only` island * Remove log
Diffstat (limited to 'packages/integrations/svelte/client.svelte.js')
-rw-r--r--packages/integrations/svelte/client.svelte.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/integrations/svelte/client.svelte.js b/packages/integrations/svelte/client.svelte.js
index 4f861e96d..85a2cd890 100644
--- a/packages/integrations/svelte/client.svelte.js
+++ b/packages/integrations/svelte/client.svelte.js
@@ -61,6 +61,9 @@ export default (element) => {
function createComponent(Component, target, props, shouldHydrate) {
let propsState = $state(props);
const bootstrap = shouldHydrate ? hydrate : mount;
+ if(!shouldHydrate) {
+ target.innerHTML = '';
+ }
const component = bootstrap(Component, { target, props: propsState });
return {
setProps(newProps) {