diff options
author | 2023-09-07 09:49:59 -0500 | |
---|---|---|
committer | 2023-09-07 09:49:59 -0500 | |
commit | 3f49aa97ab8fb4bffe50da993cae0f0027c7692d (patch) | |
tree | bbbdf0a6d6c87c58c0f631986ec0cf40487f8885 /packages/integrations/svelte/client.js | |
parent | f3f62a5a20f4881bb04f65f192df8e1ccf7fb601 (diff) | |
download | astro-3f49aa97ab8fb4bffe50da993cae0f0027c7692d.tar.gz astro-3f49aa97ab8fb4bffe50da993cae0f0027c7692d.tar.zst astro-3f49aa97ab8fb4bffe50da993cae0f0027c7692d.zip |
fix(svelte): unmount islands properly on navigation (#8448)
Diffstat (limited to '')
-rw-r--r-- | packages/integrations/svelte/client.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/integrations/svelte/client.js b/packages/integrations/svelte/client.js index 73cc305c1..9e3df4019 100644 --- a/packages/integrations/svelte/client.js +++ b/packages/integrations/svelte/client.js @@ -3,9 +3,9 @@ const noop = () => {}; let originalConsoleWarning; let consoleFilterRefs = 0; -export default (target) => { +export default (element) => { return (Component, props, slotted, { client }) => { - if (!target.hasAttribute('ssr')) return; + if (!element.hasAttribute('ssr')) return; const slots = {}; for (const [key, value] of Object.entries(slotted)) { slots[key] = createSlotDefinition(key, value); @@ -15,7 +15,7 @@ export default (target) => { if (import.meta.env.DEV) useConsoleFilter(); const component = new Component({ - target, + target: element, props: { ...props, $$slots: slots, |