fix(suspense): fix suspense regression for errored template component
fix #3857
This commit is contained in:
@@ -1073,16 +1073,19 @@ function baseCreateRenderer(
|
||||
const newVNode = newChildren[i]
|
||||
// Determine the container (parent element) for the patch.
|
||||
const container =
|
||||
// oldVNode may be an errored async setup() component inside Suspense
|
||||
// which will not have a mounted element
|
||||
oldVNode.el &&
|
||||
// - In the case of a Fragment, we need to provide the actual parent
|
||||
// of the Fragment itself so it can move its children.
|
||||
oldVNode.type === Fragment ||
|
||||
// - In the case of different nodes, there is going to be a replacement
|
||||
// which also requires the correct parent container
|
||||
!isSameVNodeType(oldVNode, newVNode) ||
|
||||
// - In the case of a component, it could contain anything.
|
||||
oldVNode.shapeFlag & ShapeFlags.COMPONENT ||
|
||||
oldVNode.shapeFlag & ShapeFlags.TELEPORT
|
||||
? hostParentNode(oldVNode.el!)!
|
||||
(oldVNode.type === Fragment ||
|
||||
// - In the case of different nodes, there is going to be a replacement
|
||||
// which also requires the correct parent container
|
||||
!isSameVNodeType(oldVNode, newVNode) ||
|
||||
// - In the case of a component, it could contain anything.
|
||||
oldVNode.shapeFlag & ShapeFlags.COMPONENT ||
|
||||
oldVNode.shapeFlag & ShapeFlags.TELEPORT)
|
||||
? hostParentNode(oldVNode.el)!
|
||||
: // In other cases, the parent container is not actually used so we
|
||||
// just pass the block element here to avoid a DOM parentNode call.
|
||||
fallbackContainer
|
||||
|
||||
Reference in New Issue
Block a user