pull/12335/head
Rich Harris 2 years ago
parent 0343fc3e8b
commit c23e5ea80a

@ -63,7 +63,12 @@ export function child(node) {
return node.firstChild; return node.firstChild;
} }
var child = hydrate_node.firstChild; // TODO is there anything we can do in compiler land to optimize the `<template>` edge case?
var child = /** @type {TemplateNode} */ (
hydrate_node.nodeName === 'TEMPLATE'
? /** @type {HTMLTemplateElement} */ (hydrate_node).content.firstChild
: hydrate_node.firstChild
);
// Child can be null if we have an element with a single child, like `<p>{text}</p>`, where `text` is empty // Child can be null if we have an element with a single child, like `<p>{text}</p>`, where `text` is empty
if (child === null) { if (child === null) {

Loading…
Cancel
Save