fix(suspence): fix newBranch shapeFlag not reset under hmr

This commit is contained in:
yangchangtao 2025-03-20 20:09:21 +08:00
parent 119f18c773
commit d2e2a192ef
1 changed files with 3 additions and 3 deletions

View File

@ -235,7 +235,7 @@ function patchSuspense(
const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense
if (pendingBranch) {
suspense.pendingBranch = newBranch
if (isSameVNodeType(newBranch, pendingBranch)) {
if (isSameVNodeType(pendingBranch, newBranch)) {
// same root type but content may have changed.
patch(
pendingBranch,
@ -321,7 +321,7 @@ function patchSuspense(
)
setActiveBranch(suspense, newFallback)
}
} else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
} else if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
// toggled "back" to current active branch
patch(
activeBranch,
@ -355,7 +355,7 @@ function patchSuspense(
}
}
} else {
if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
// root did not change, just normal patch
patch(
activeBranch,