fix(runtime): do not render empty Fragment (#2667)
This commit fixes the bug when returning an empty Fragment which makes it undefined. This is because unescapeHTML (raw) will create a String object with an 'undefined' string. To fix this we need to check if the `children` is null or undefined before marking a string as raw.
This commit is contained in:
parent
046af36475
commit
8fb1f53e96
1 changed files with 3 additions and 0 deletions
|
@ -131,6 +131,9 @@ export async function renderComponent(result: SSRResult, displayName: string, Co
|
|||
const children = await renderSlot(result, slots?.default);
|
||||
|
||||
if (Component === Fragment) {
|
||||
if (children == null) {
|
||||
return children;
|
||||
}
|
||||
return unescapeHTML(children);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue