fix(runtime-core): patchChildren first in patchElement (#4313)
This commit is contained in:
@@ -840,6 +840,35 @@ function baseCreateRenderer(
|
||||
dynamicChildren = null
|
||||
}
|
||||
|
||||
const areChildrenSVG = isSVG && n2.type !== 'foreignObject'
|
||||
if (dynamicChildren) {
|
||||
patchBlockChildren(
|
||||
n1.dynamicChildren!,
|
||||
dynamicChildren,
|
||||
el,
|
||||
parentComponent,
|
||||
parentSuspense,
|
||||
areChildrenSVG,
|
||||
slotScopeIds
|
||||
)
|
||||
if (__DEV__ && parentComponent && parentComponent.type.__hmrId) {
|
||||
traverseStaticChildren(n1, n2)
|
||||
}
|
||||
} else if (!optimized) {
|
||||
// full diff
|
||||
patchChildren(
|
||||
n1,
|
||||
n2,
|
||||
el,
|
||||
null,
|
||||
parentComponent,
|
||||
parentSuspense,
|
||||
areChildrenSVG,
|
||||
slotScopeIds,
|
||||
false
|
||||
)
|
||||
}
|
||||
|
||||
if (patchFlag > 0) {
|
||||
// the presence of a patchFlag means this element's render code was
|
||||
// generated by the compiler and can take the fast path.
|
||||
@@ -922,35 +951,6 @@ function baseCreateRenderer(
|
||||
)
|
||||
}
|
||||
|
||||
const areChildrenSVG = isSVG && n2.type !== 'foreignObject'
|
||||
if (dynamicChildren) {
|
||||
patchBlockChildren(
|
||||
n1.dynamicChildren!,
|
||||
dynamicChildren,
|
||||
el,
|
||||
parentComponent,
|
||||
parentSuspense,
|
||||
areChildrenSVG,
|
||||
slotScopeIds
|
||||
)
|
||||
if (__DEV__ && parentComponent && parentComponent.type.__hmrId) {
|
||||
traverseStaticChildren(n1, n2)
|
||||
}
|
||||
} else if (!optimized) {
|
||||
// full diff
|
||||
patchChildren(
|
||||
n1,
|
||||
n2,
|
||||
el,
|
||||
null,
|
||||
parentComponent,
|
||||
parentSuspense,
|
||||
areChildrenSVG,
|
||||
slotScopeIds,
|
||||
false
|
||||
)
|
||||
}
|
||||
|
||||
if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
|
||||
queuePostRenderEffect(() => {
|
||||
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1)
|
||||
|
||||
Reference in New Issue
Block a user