Skip to content

Commit a6e0398

Browse files
committed
fix: preserve current hydration node during slot insertion
1 parent bcdcc67 commit a6e0398

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/runtime-vapor/src/component.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,12 +568,19 @@ export function createComponentWithFallback(
568568
}
569569

570570
if (rawSlots) {
571-
isHydrating && setCurrentHydrationNode(el.firstChild)
571+
let prev: Node
572+
if (isHydrating) {
573+
prev = currentHydrationNode!
574+
setCurrentHydrationNode(el.firstChild)
575+
}
572576
if (rawSlots.$) {
573577
// TODO dynamic slot fragment
574578
} else {
575579
insert(getSlot(rawSlots as RawSlots, 'default')!(), el)
576580
}
581+
if (isHydrating) {
582+
setCurrentHydrationNode(prev!)
583+
}
577584
}
578585

579586
if (!isHydrating && _insertionParent) {

0 commit comments

Comments
 (0)