0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00

chore: changeset (#3873)

This commit is contained in:
Ben Holmes 2022-07-08 19:04:27 -04:00 committed by GitHub
parent f9ed77bb0d
commit 957fb50541
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Fix hydration for SSR components that return null

View file

@ -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)

View file

@ -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'