From dd21175dd48ad8c696384467be04f2947f4bc5b2 Mon Sep 17 00:00:00 2001 From: linzhe141 <1572213544@qq.com> Date: Wed, 15 Jan 2025 12:21:34 +0800 Subject: [PATCH] fix: add optimization check for patchFlag --- packages/runtime-core/src/renderer.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/runtime-core/src/renderer.ts b/packages/runtime-core/src/renderer.ts index 90cc22f5470..260995ca980 100644 --- a/packages/runtime-core/src/renderer.ts +++ b/packages/runtime-core/src/renderer.ts @@ -872,7 +872,7 @@ function baseCreateRenderer( ) } - if (patchFlag > 0) { + if (optimized && patchFlag > 0) { // the presence of a patchFlag means this element's render code was // generated by the compiler and can take the fast path. // in this path old node and new node are guaranteed to have the same shape @@ -923,7 +923,7 @@ function baseCreateRenderer( hostSetElementText(el, n2.children as string) } } - } else if (!optimized && dynamicChildren == null) { + } else if (dynamicChildren == null) { // unoptimized, full diff patchProps(el, oldProps, newProps, parentComponent, namespace) }