fix(runtime-core): fix child component double update on props change

fix #4365
This commit is contained in:
Evan You
2021-08-17 10:57:28 -04:00
parent 57f10812cc
commit c1f564e1dc
2 changed files with 34 additions and 2 deletions

View File

@@ -1458,6 +1458,9 @@ function baseCreateRenderer(
pushWarningContext(next || instance.vnode)
}
// Disallow component effect recursion during pre-lifecycle hooks.
effect.allowRecurse = false
if (next) {
next.el = vnode.el
updateComponentPreRender(instance, next, optimized)
@@ -1465,8 +1468,6 @@ function baseCreateRenderer(
next = vnode
}
// Disallow component effect recursion during pre-lifecycle hooks.
effect.allowRecurse = false
// beforeUpdate hook
if (bu) {
invokeArrayFns(bu)
@@ -1481,6 +1482,7 @@ function baseCreateRenderer(
) {
instance.emit('hook:beforeUpdate')
}
effect.allowRecurse = true
// render