From 045d7bb73f9140f6abd9389864385ee37f628607 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Fri, 19 Aug 2022 12:42:13 -0400 Subject: [PATCH] fix: update to astro-island --- packages/integrations/spa/client.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/integrations/spa/client.js b/packages/integrations/spa/client.js index 041c4668a0..df746b47a9 100644 --- a/packages/integrations/spa/client.js +++ b/packages/integrations/spa/client.js @@ -5,7 +5,7 @@ export default () => beforeDiff(doc) { for (const island of doc.querySelectorAll('astro-root')) { const uid = island.getAttribute('uid'); - const current = document.querySelector(`astro-root[uid="${uid}"]`); + const current = document.querySelector(`astro-island[uid="${uid}"]`); if (current) { current.dataset.persist = true; island.replaceWith(current); @@ -13,9 +13,9 @@ export default () => } }, afterDiff() { - for (const island of document.querySelectorAll('astro-root')) { + for (const island of document.querySelectorAll('astro-island')) { delete island.dataset.persist; } - window.dispatchEvent(new CustomEvent('astro:locationchange')); + window.dispatchEvent(new CustomEvent('astro:hydrate')); }, });