From 0dd5cde861735e80cfe21537380e52789cc865f8 Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 26 Jun 2020 18:05:53 -0400 Subject: [PATCH] fix(runtime-core): handle patch flag de-op from cloned vnode close #1426 --- packages/runtime-core/src/renderer.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/runtime-core/src/renderer.ts b/packages/runtime-core/src/renderer.ts index edc00d175..4dfc2ab66 100644 --- a/packages/runtime-core/src/renderer.ts +++ b/packages/runtime-core/src/renderer.ts @@ -780,7 +780,10 @@ function baseCreateRenderer( ) => { const el = (n2.el = n1.el!) let { patchFlag, dynamicChildren, dirs } = n2 - const oldProps = (n1 && n1.props) || EMPTY_OBJ + // #1426 take the old vnode's patch flag into account since user may clone a + // compiler-generated vnode, which de-opts to FULL_PROPS + patchFlag |= n1.patchFlag & PatchFlags.FULL_PROPS + const oldProps = n1.props || EMPTY_OBJ const newProps = n2.props || EMPTY_OBJ let vnodeHook: VNodeHook | undefined | null