astro/.changeset/unlucky-lamps-remember.md
Matthew Phillips 3d525efc95
Prevent removal of nested slots within islands (#7093)
* Prevent removal of nested slots within islands

* Fix build errors
2023-05-17 10:18:04 -04:00

718 B

@astrojs/preact @astrojs/svelte @astrojs/react @astrojs/solid-js @astrojs/vue astro
minor minor minor minor minor minor

Prevent removal of nested slots within islands

This change introduces a new flag that renderers can add called supportsAstroStaticSlot. What this does is let Astro know that the render is sending <astro-static-slot> as placeholder values for static (non-hydrated) slots which Astro will then remove.

This change is completely backwards compatible, but fixes bugs caused by combining ssr-only and client-side framework components like so:

<Component>
  <div>
    <Component client:load>
      <span>Nested</span>
    </Component>
  </div>
</Component>