diff --git a/src/runtime/server/astro-island.ts b/src/runtime/server/astro-island.ts index 4f743263110b..d3a22a5c2d09 100644 --- a/src/runtime/server/astro-island.ts +++ b/src/runtime/server/astro-island.ts @@ -42,7 +42,7 @@ declare const Astro: { public hydrator: any; static observedAttributes = ['props']; connectedCallback() { - if (this.getAttribute('client') === 'only' || this.firstChild) { + if (!this.getAttribute('await-children') || this.firstChild) { this.childrenConnectedCallback(); } else { // connectedCallback may run *before* children are rendered (ex. HTML streaming) diff --git a/src/runtime/server/index.ts b/src/runtime/server/index.ts index 230c043edb3e..8188e716520b 100644 --- a/src/runtime/server/index.ts +++ b/src/runtime/server/index.ts @@ -452,6 +452,10 @@ If you're still stuck, please open an issue on GitHub or join us at https://astr island.children = `${html ?? ''}${template}`; + if (island.children) { + island.props['await-children'] = '' + } + // Scripts to prepend let prescriptType: PrescriptType = needsHydrationScript ? 'both'