Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Teleport): avoid changing the reference of vnode.dynamicChildren #3642

Merged
merged 1 commit into from
May 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/runtime-core/src/components/Teleport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ export const TeleportImpl = {
} = internals

const disabled = isTeleportDisabled(n2.props)
const { shapeFlag, children } = n2
let { shapeFlag, children, dynamicChildren } = n2

// #3302
// HMR updated, force full diff
if (__DEV__ && isHmrUpdating) {
optimized = false
n2.dynamicChildren = null
dynamicChildren = null
}

if (n1 == null) {
Expand Down Expand Up @@ -146,11 +146,11 @@ export const TeleportImpl = {
const currentAnchor = wasDisabled ? mainAnchor : targetAnchor
isSVG = isSVG || isTargetSVG(target)

if (n2.dynamicChildren) {
if (dynamicChildren) {
// fast path when the teleport happens to be a block root
patchBlockChildren(
n1.dynamicChildren!,
n2.dynamicChildren,
dynamicChildren,
currentContainer,
parentComponent,
parentSuspense,
Expand Down