فهرست منبع

fix(compat): ensure fallthrough *Native events are not dropped during props update (#5228)

Thorsten Lünborg 4 سال پیش
والد
کامیت
97f6bd942f
1فایلهای تغییر یافته به همراه5 افزوده شده و 1 حذف شده
  1. 5 1
      packages/runtime-core/src/componentProps.ts

+ 5 - 1
packages/runtime-core/src/componentProps.ts

@@ -303,7 +303,11 @@ export function updateProps(
     // attrs point to the same object so it should already have been updated.
     if (attrs !== rawCurrentProps) {
       for (const key in attrs) {
-        if (!rawProps || !hasOwn(rawProps, key)) {
+        if (
+          !rawProps ||
+          (!hasOwn(rawProps, key) &&
+            (!__COMPAT__ || !hasOwn(rawProps, key + 'Native')))
+        ) {
           delete attrs[key]
           hasAttrsChanged = true
         }