Explorar o código

fix(hydration): pass nextSibling to locateTeleportEndAnchor for null target

daiwei hai 1 mes
pai
achega
abe8fcd79c
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      packages/runtime-vapor/src/components/Teleport.ts

+ 3 - 1
packages/runtime-vapor/src/components/Teleport.ts

@@ -381,7 +381,9 @@ export class TeleportFragment extends VaporFragment {
     } else {
       // enabled teleport with null target: init children without
       // hydration since there's no target to hydrate into.
-      this.mountAnchor = this.anchor = locateTeleportEndAnchor()!
+      this.mountAnchor = this.anchor = locateTeleportEndAnchor(
+        currentHydrationNode!.nextSibling!,
+      )!
       this.mountContainer = this.anchor && this.anchor.parentNode
       runWithoutHydration(this.initChildren.bind(this))
     }