Skip to content

Commit a84ca77

Browse files
Merge branch 'master' into update-deps
2 parents af92cff + 2c53b0a commit a84ca77

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

.changeset/famous-dolls-leave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"preact-cli": patch
3+
---
4+
5+
fix: allow an async component to return null rendering

packages/async-loader/async.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,11 @@ export default function async(load) {
4949
const me =
5050
(prev && prev.nextSibling) || (this.__P || this._parentDom).firstChild;
5151

52-
return (
53-
me &&
54-
h(me.localName, {
55-
dangerouslySetInnerHTML: PENDING,
56-
})
57-
);
52+
if (!me) return;
53+
if (me.nodeType === 3) return me.data;
54+
return h(me.localName, {
55+
dangerouslySetInnerHTML: PENDING,
56+
});
5857
};
5958
}
6059

0 commit comments

Comments
 (0)