Skip to content
Permalink
Browse files
fix(runtime-core): unset removed props first in full diff mode
fix #6571
  • Loading branch information
yyx990803 committed Sep 27, 2022
1 parent c71a08e commit c0d8db81a636f0ad1e725b7c04608d3a211cf163
Showing 1 changed file with 17 additions and 17 deletions.
@@ -1005,6 +1005,23 @@ function baseCreateRenderer(
isSVG: boolean
) => {
if (oldProps !== newProps) {
if (oldProps !== EMPTY_OBJ) {
for (const key in oldProps) {
if (!isReservedProp(key) && !(key in newProps)) {
hostPatchProp(
el,
key,
oldProps[key],
null,
isSVG,
vnode.children as VNode[],
parentComponent,
parentSuspense,
unmountChildren
)
}
}
}
for (const key in newProps) {
// empty string is not valid prop
if (isReservedProp(key)) continue
@@ -1025,23 +1042,6 @@ function baseCreateRenderer(
)
}
}
if (oldProps !== EMPTY_OBJ) {
for (const key in oldProps) {
if (!isReservedProp(key) && !(key in newProps)) {
hostPatchProp(
el,
key,
oldProps[key],
null,
isSVG,
vnode.children as VNode[],
parentComponent,
parentSuspense,
unmountChildren
)
}
}
}
if ('value' in newProps) {
hostPatchProp(el, 'value', oldProps.value, newProps.value)
}

0 comments on commit c0d8db8

Please sign in to comment.