fix(runtime-core): enter optimized mode for component as root

fix #3943
This commit is contained in:
Evan You 2021-07-15 18:51:59 -04:00
parent 1cfe290352
commit 68365b9b2b

View File

@ -487,7 +487,7 @@ function baseCreateRenderer(
parentSuspense = null,
isSVG = false,
slotScopeIds = null,
optimized = false
optimized = __DEV__ && isHmrUpdating ? false : !!n2.dynamicChildren
) => {
// patching & not same type, unmount old tree
if (n1 && !isSameVNodeType(n1, n2)) {
@ -772,7 +772,7 @@ function baseCreateRenderer(
parentSuspense,
isSVG && type !== 'foreignObject',
slotScopeIds,
optimized || !!vnode.dynamicChildren
optimized
)
}