diff --git a/ReactCommon/react/renderer/components/text/BaseTextProps.cpp b/ReactCommon/react/renderer/components/text/BaseTextProps.cpp index b660b6d7cbbc3a..88189288fdfb6c 100644 --- a/ReactCommon/react/renderer/components/text/BaseTextProps.cpp +++ b/ReactCommon/react/renderer/components/text/BaseTextProps.cpp @@ -12,20 +12,17 @@ #include #include -#define GET_FIELD_VALUE(field, fieldName, defaultValue, rawValue) \ - (rawValue.hasValue() ? ([&rawValue, &context] { \ - decltype(defaultValue) res; \ - fromRawValue(context, rawValue, res); \ - return res; \ - }()) \ - : defaultValue); - -#define REBUILD_FIELD_SWITCH_CASE( \ - defaults, rawValue, property, field, fieldName) \ - case CONSTEXPR_RAW_PROPS_KEY_HASH(fieldName): { \ - property.field = \ - GET_FIELD_VALUE(field, fieldName, defaults.field, rawValue); \ - return; \ +#define REBUILD_FIELD_SWITCH_CASE( \ + defaults, rawValue, property, field, fieldName) \ + case CONSTEXPR_RAW_PROPS_KEY_HASH(fieldName): { \ + if (rawValue.hasValue()) { \ + decltype(defaults.field) res; \ + fromRawValue(context, rawValue, res); \ + property.field = res; \ + } else { \ + property.field = defaults.field; \ + } \ + return; \ } namespace facebook { diff --git a/ReactCommon/react/renderer/components/view/ViewProps.cpp b/ReactCommon/react/renderer/components/view/ViewProps.cpp index 10067604153056..3bdc56de17940f 100644 --- a/ReactCommon/react/renderer/components/view/ViewProps.cpp +++ b/ReactCommon/react/renderer/components/view/ViewProps.cpp @@ -258,18 +258,15 @@ ViewProps::ViewProps( #endif {}; -#define VIEW_EVENT_CASE(eventType, eventString) \ - case CONSTEXPR_RAW_PROPS_KEY_HASH(eventString): { \ - ViewEvents defaultViewEvents{}; \ - events[eventType] = [ defaultViewEvents, &value, &context ]() constexpr { \ - bool res = defaultViewEvents[eventType]; \ - if (value.hasValue()) { \ - fromRawValue(context, value, res); \ - } \ - return res; \ - } \ - (); \ - return; \ +#define VIEW_EVENT_CASE(eventType, eventString) \ + case CONSTEXPR_RAW_PROPS_KEY_HASH(eventString): { \ + ViewEvents defaultViewEvents{}; \ + bool res = defaultViewEvents[eventType]; \ + if (value.hasValue()) { \ + fromRawValue(context, value, res); \ + } \ + events[eventType] = res; \ + return; \ } void ViewProps::setProp( diff --git a/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h b/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h index b2657e037f0c2f..77c60b0a1356dd 100644 --- a/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +++ b/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h @@ -119,7 +119,7 @@ class ConcreteComponentDescriptor : public ComponentDescriptor { rawProps.iterateOverValues([&](RawPropsPropNameHash hash, const char *propName, RawValue const &fn) { - shadowNodeProps.get()->Props::setProp(context, hash, propName, fn); + shadowNodeProps.get()->setProp(context, hash, propName, fn); }); } diff --git a/ReactCommon/react/renderer/core/PropsMacros.h b/ReactCommon/react/renderer/core/PropsMacros.h index 9064031bac8606..d41b0c68d2f7ce 100644 --- a/ReactCommon/react/renderer/core/PropsMacros.h +++ b/ReactCommon/react/renderer/core/PropsMacros.h @@ -19,7 +19,7 @@ // Get hash at compile-time. sizeof(str) - 1 == strlen #define CONSTEXPR_RAW_PROPS_KEY_HASH(s) \ - ([]() constexpr { \ + ([]() constexpr->RawPropsPropNameHash { \ CLANG_PRAGMA("clang diagnostic push") \ CLANG_PRAGMA("clang diagnostic ignored \"-Wshadow\"") \ return folly::hash::fnv32_buf(s, sizeof(s) - 1); \