diff --git a/packages/react-native-codegen/e2e/deep_imports/__tests__/components/__snapshots__/GeneratePropsCpp-test.js.snap b/packages/react-native-codegen/e2e/deep_imports/__tests__/components/__snapshots__/GeneratePropsCpp-test.js.snap index 27bb4f53ac0e..5d7e967a4a68 100644 --- a/packages/react-native-codegen/e2e/deep_imports/__tests__/components/__snapshots__/GeneratePropsCpp-test.js.snap +++ b/packages/react-native-codegen/e2e/deep_imports/__tests__/components/__snapshots__/GeneratePropsCpp-test.js.snap @@ -37,6 +37,58 @@ ArrayPropsNativeComponentViewProps::ArrayPropsNativeComponentViewProps( object(convertRawProp(context, rawProps, \\"object\\", sourceProps.object, {})), arrayOfObjects(convertRawProp(context, rawProps, \\"arrayOfObjects\\", sourceProps.arrayOfObjects, {})), arrayOfMixed(convertRawProp(context, rawProps, \\"arrayOfMixed\\", sourceProps.arrayOfMixed, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void ArrayPropsNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"names\\"): + this->names = convertRawPropValuenames)>(propsParserContext, rawValue, \\"names\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"disableds\\"): + this->disableds = convertRawPropValuedisableds)>(propsParserContext, rawValue, \\"disableds\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"progress\\"): + this->progress = convertRawPropValueprogress)>(propsParserContext, rawValue, \\"progress\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"radii\\"): + this->radii = convertRawPropValueradii)>(propsParserContext, rawValue, \\"radii\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"colors\\"): + this->colors = convertRawPropValuecolors)>(propsParserContext, rawValue, \\"colors\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"srcs\\"): + this->srcs = convertRawPropValuesrcs)>(propsParserContext, rawValue, \\"srcs\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"points\\"): + this->points = convertRawPropValuepoints)>(propsParserContext, rawValue, \\"points\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"edgeInsets\\"): + this->edgeInsets = convertRawPropValueedgeInsets)>(propsParserContext, rawValue, \\"edgeInsets\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"dimensions\\"): + this->dimensions = convertRawPropValuedimensions)>(propsParserContext, rawValue, \\"dimensions\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"sizes\\"): + this->sizes = convertRawPropValue(propsParserContext, rawValue, \\"sizes\\", {static_cast(ArrayPropsNativeComponentViewSizes::Small)}).value; + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"object\\"): + this->object = convertRawPropValueobject)>(propsParserContext, rawValue, \\"object\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"arrayOfObjects\\"): + this->arrayOfObjects = convertRawPropValuearrayOfObjects)>(propsParserContext, rawValue, \\"arrayOfObjects\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"arrayOfMixed\\"): + this->arrayOfMixed = convertRawPropValuearrayOfMixed)>(propsParserContext, rawValue, \\"arrayOfMixed\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName ArrayPropsNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -138,6 +190,25 @@ BooleanPropNativeComponentViewProps::BooleanPropNativeComponentViewProps( disabled(convertRawProp(context, rawProps, \\"disabled\\", sourceProps.disabled, {false})), disabledNullable(convertRawProp(context, rawProps, \\"disabledNullable\\", sourceProps.disabledNullable, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void BooleanPropNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"disabled\\"): + this->disabled = convertRawPropValuedisabled)>(propsParserContext, rawValue, \\"disabled\\", {false}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"disabledNullable\\"): + this->disabledNullable = convertRawPropValuedisabledNullable)>(propsParserContext, rawValue, \\"disabledNullable\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName BooleanPropNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -194,6 +265,22 @@ ColorPropNativeComponentViewProps::ColorPropNativeComponentViewProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), tintColor(convertRawProp(context, rawProps, \\"tintColor\\", sourceProps.tintColor, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void ColorPropNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"tintColor\\"): + this->tintColor = convertRawPropValuetintColor)>(propsParserContext, rawValue, \\"tintColor\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName ColorPropNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -247,6 +334,22 @@ DimensionPropNativeComponentViewProps::DimensionPropNativeComponentViewProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), marginBack(convertRawProp(context, rawProps, \\"marginBack\\", sourceProps.marginBack, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void DimensionPropNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"marginBack\\"): + this->marginBack = convertRawPropValuemarginBack)>(propsParserContext, rawValue, \\"marginBack\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName DimensionPropNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -299,6 +402,16 @@ EdgeInsetsPropNativeComponentViewProps::EdgeInsetsPropNativeComponentViewProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void EdgeInsetsPropNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName EdgeInsetsPropNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -349,6 +462,25 @@ EnumPropNativeComponentViewProps::EnumPropNativeComponentViewProps( alignment(convertRawProp(context, rawProps, \\"alignment\\", sourceProps.alignment, {EnumPropNativeComponentViewAlignment::Center})), intervals(convertRawProp(context, rawProps, \\"intervals\\", sourceProps.intervals, {EnumPropNativeComponentViewIntervals::Intervals0})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void EnumPropNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"alignment\\"): + this->alignment = convertRawPropValuealignment)>(propsParserContext, rawValue, \\"alignment\\", {EnumPropNativeComponentViewAlignment::Center}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"intervals\\"): + this->intervals = convertRawPropValueintervals)>(propsParserContext, rawValue, \\"intervals\\", {EnumPropNativeComponentViewIntervals::Intervals0}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName EnumPropNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -405,6 +537,22 @@ EventNestedObjectPropsNativeComponentViewProps::EventNestedObjectPropsNativeComp const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), disabled(convertRawProp(context, rawProps, \\"disabled\\", sourceProps.disabled, {false})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void EventNestedObjectPropsNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"disabled\\"): + this->disabled = convertRawPropValuedisabled)>(propsParserContext, rawValue, \\"disabled\\", {false}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName EventNestedObjectPropsNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -457,6 +605,22 @@ EventPropsNativeComponentViewProps::EventPropsNativeComponentViewProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), disabled(convertRawProp(context, rawProps, \\"disabled\\", sourceProps.disabled, {false})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void EventPropsNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"disabled\\"): + this->disabled = convertRawPropValuedisabled)>(propsParserContext, rawValue, \\"disabled\\", {false}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName EventPropsNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -515,6 +679,40 @@ FloatPropsNativeComponentViewProps::FloatPropsNativeComponentViewProps( blurRadius5(convertRawProp(context, rawProps, \\"blurRadius5\\", sourceProps.blurRadius5, {1.0})), blurRadius6(convertRawProp(context, rawProps, \\"blurRadius6\\", sourceProps.blurRadius6, {0.0})), blurRadiusNullable(convertRawProp(context, rawProps, \\"blurRadiusNullable\\", sourceProps.blurRadiusNullable, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void FloatPropsNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"blurRadius\\"): + this->blurRadius = convertRawPropValueblurRadius)>(propsParserContext, rawValue, \\"blurRadius\\", {0.0}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"blurRadius2\\"): + this->blurRadius2 = convertRawPropValueblurRadius2)>(propsParserContext, rawValue, \\"blurRadius2\\", {0.001}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"blurRadius3\\"): + this->blurRadius3 = convertRawPropValueblurRadius3)>(propsParserContext, rawValue, \\"blurRadius3\\", {2.1}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"blurRadius4\\"): + this->blurRadius4 = convertRawPropValueblurRadius4)>(propsParserContext, rawValue, \\"blurRadius4\\", {0.0}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"blurRadius5\\"): + this->blurRadius5 = convertRawPropValueblurRadius5)>(propsParserContext, rawValue, \\"blurRadius5\\", {1.0}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"blurRadius6\\"): + this->blurRadius6 = convertRawPropValueblurRadius6)>(propsParserContext, rawValue, \\"blurRadius6\\", {0.0}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"blurRadiusNullable\\"): + this->blurRadiusNullable = convertRawPropValueblurRadiusNullable)>(propsParserContext, rawValue, \\"blurRadiusNullable\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName FloatPropsNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -592,6 +790,22 @@ ImagePropNativeComponentViewProps::ImagePropNativeComponentViewProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), thumbImage(convertRawProp(context, rawProps, \\"thumbImage\\", sourceProps.thumbImage, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void ImagePropNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"thumbImage\\"): + this->thumbImage = convertRawPropValuethumbImage)>(propsParserContext, rawValue, \\"thumbImage\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName ImagePropNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -646,6 +860,28 @@ IntegerPropNativeComponentViewProps::IntegerPropNativeComponentViewProps( progress1(convertRawProp(context, rawProps, \\"progress1\\", sourceProps.progress1, {0})), progress2(convertRawProp(context, rawProps, \\"progress2\\", sourceProps.progress2, {-1})), progress3(convertRawProp(context, rawProps, \\"progress3\\", sourceProps.progress3, {10})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void IntegerPropNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"progress1\\"): + this->progress1 = convertRawPropValueprogress1)>(propsParserContext, rawValue, \\"progress1\\", {0}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"progress2\\"): + this->progress2 = convertRawPropValueprogress2)>(propsParserContext, rawValue, \\"progress2\\", {-1}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"progress3\\"): + this->progress3 = convertRawPropValueprogress3)>(propsParserContext, rawValue, \\"progress3\\", {10}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName IntegerPropNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -706,6 +942,22 @@ InterfaceOnlyNativeComponentViewProps::InterfaceOnlyNativeComponentViewProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), title(convertRawProp(context, rawProps, \\"title\\", sourceProps.title, {std::string{\\"\\"}})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void InterfaceOnlyNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"title\\"): + this->title = convertRawPropValuetitle)>(propsParserContext, rawValue, \\"title\\", {std::string{\\"\\"}}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName InterfaceOnlyNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -759,6 +1011,22 @@ MixedPropNativeComponentViewProps::MixedPropNativeComponentViewProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), mixedProp(convertRawProp(context, rawProps, \\"mixedProp\\", sourceProps.mixedProp, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void MixedPropNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"mixedProp\\"): + this->mixedProp = convertRawPropValuemixedProp)>(propsParserContext, rawValue, \\"mixedProp\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName MixedPropNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -815,6 +1083,31 @@ MultiNativePropNativeComponentViewProps::MultiNativePropNativeComponentViewProps color(convertRawProp(context, rawProps, \\"color\\", sourceProps.color, {})), thumbTintColor(convertRawProp(context, rawProps, \\"thumbTintColor\\", sourceProps.thumbTintColor, {})), point(convertRawProp(context, rawProps, \\"point\\", sourceProps.point, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void MultiNativePropNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"thumbImage\\"): + this->thumbImage = convertRawPropValuethumbImage)>(propsParserContext, rawValue, \\"thumbImage\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"color\\"): + this->color = convertRawPropValuecolor)>(propsParserContext, rawValue, \\"color\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"thumbTintColor\\"): + this->thumbTintColor = convertRawPropValuethumbTintColor)>(propsParserContext, rawValue, \\"thumbTintColor\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"point\\"): + this->point = convertRawPropValuepoint)>(propsParserContext, rawValue, \\"point\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName MultiNativePropNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -879,6 +1172,16 @@ NoPropsNoEventsNativeComponentViewProps::NoPropsNoEventsNativeComponentViewProps const RawProps &rawProps): ViewProps(context, sourceProps, rawProps) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void NoPropsNoEventsNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName NoPropsNoEventsNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -931,6 +1234,28 @@ ObjectPropsNativeComponentProps::ObjectPropsNativeComponentProps( objectProp(convertRawProp(context, rawProps, \\"objectProp\\", sourceProps.objectProp, {})), objectArrayProp(convertRawProp(context, rawProps, \\"objectArrayProp\\", sourceProps.objectArrayProp, {})), objectPrimitiveRequiredProp(convertRawProp(context, rawProps, \\"objectPrimitiveRequiredProp\\", sourceProps.objectPrimitiveRequiredProp, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void ObjectPropsNativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"objectProp\\"): + this->objectProp = convertRawPropValueobjectProp)>(propsParserContext, rawValue, \\"objectProp\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"objectArrayProp\\"): + this->objectArrayProp = convertRawPropValueobjectArrayProp)>(propsParserContext, rawValue, \\"objectArrayProp\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"objectPrimitiveRequiredProp\\"): + this->objectPrimitiveRequiredProp = convertRawPropValueobjectPrimitiveRequiredProp)>(propsParserContext, rawValue, \\"objectPrimitiveRequiredProp\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName ObjectPropsNativeComponentProps::getDiffPropsImplementationTarget() const { @@ -991,6 +1316,22 @@ PointPropNativeComponentViewProps::PointPropNativeComponentViewProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), startPoint(convertRawProp(context, rawProps, \\"startPoint\\", sourceProps.startPoint, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void PointPropNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"startPoint\\"): + this->startPoint = convertRawPropValuestartPoint)>(propsParserContext, rawValue, \\"startPoint\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName PointPropNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -1044,6 +1385,25 @@ StringPropNativeComponentViewProps::StringPropNativeComponentViewProps( placeholder(convertRawProp(context, rawProps, \\"placeholder\\", sourceProps.placeholder, {std::string{\\"\\"}})), defaultValue(convertRawProp(context, rawProps, \\"defaultValue\\", sourceProps.defaultValue, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void StringPropNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"placeholder\\"): + this->placeholder = convertRawPropValueplaceholder)>(propsParserContext, rawValue, \\"placeholder\\", {std::string{\\"\\"}}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"defaultValue\\"): + this->defaultValue = convertRawPropValuedefaultValue)>(propsParserContext, rawValue, \\"defaultValue\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName StringPropNativeComponentViewProps::getDiffPropsImplementationTarget() const { diff --git a/packages/react-native-codegen/e2e/deep_imports/__tests__/components/__snapshots__/GeneratePropsH-test.js.snap b/packages/react-native-codegen/e2e/deep_imports/__tests__/components/__snapshots__/GeneratePropsH-test.js.snap index 4612c34717bd..c12d6e9aef51 100644 --- a/packages/react-native-codegen/e2e/deep_imports/__tests__/components/__snapshots__/GeneratePropsH-test.js.snap +++ b/packages/react-native-codegen/e2e/deep_imports/__tests__/components/__snapshots__/GeneratePropsH-test.js.snap @@ -26,7 +26,7 @@ namespace facebook::react { using ArrayPropsNativeComponentViewSizesMask = uint32_t; struct ArrayPropsNativeComponentViewSizesMaskWrapped { - ArrayPropsNativeComponentViewSizesMask value; + ArrayPropsNativeComponentViewSizesMask value{}; }; enum class ArrayPropsNativeComponentViewSizes: ArrayPropsNativeComponentViewSizesMask { @@ -180,6 +180,10 @@ class ArrayPropsNativeComponentViewProps final : public ViewProps { ArrayPropsNativeComponentViewProps() = default; ArrayPropsNativeComponentViewProps(const PropsParserContext& context, const ArrayPropsNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props std::vector names{}; @@ -233,6 +237,10 @@ class BooleanPropNativeComponentViewProps final : public ViewProps { BooleanPropNativeComponentViewProps() = default; BooleanPropNativeComponentViewProps(const PropsParserContext& context, const BooleanPropNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props bool disabled{false}; @@ -276,6 +284,10 @@ class ColorPropNativeComponentViewProps final : public ViewProps { ColorPropNativeComponentViewProps() = default; ColorPropNativeComponentViewProps(const PropsParserContext& context, const ColorPropNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props SharedColor tintColor{}; @@ -318,6 +330,10 @@ class DimensionPropNativeComponentViewProps final : public ViewProps { DimensionPropNativeComponentViewProps() = default; DimensionPropNativeComponentViewProps(const PropsParserContext& context, const DimensionPropNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props YGValue marginBack{}; @@ -359,6 +375,10 @@ class EdgeInsetsPropNativeComponentViewProps final : public ViewProps { EdgeInsetsPropNativeComponentViewProps() = default; EdgeInsetsPropNativeComponentViewProps(const PropsParserContext& context, const EdgeInsetsPropNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props @@ -472,6 +492,10 @@ class EnumPropNativeComponentViewProps final : public ViewProps { EnumPropNativeComponentViewProps() = default; EnumPropNativeComponentViewProps(const PropsParserContext& context, const EnumPropNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props EnumPropNativeComponentViewAlignment alignment{EnumPropNativeComponentViewAlignment::Center}; @@ -514,6 +538,10 @@ class EventNestedObjectPropsNativeComponentViewProps final : public ViewProps { EventNestedObjectPropsNativeComponentViewProps() = default; EventNestedObjectPropsNativeComponentViewProps(const PropsParserContext& context, const EventNestedObjectPropsNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props bool disabled{false}; @@ -555,6 +583,10 @@ class EventPropsNativeComponentViewProps final : public ViewProps { EventPropsNativeComponentViewProps() = default; EventPropsNativeComponentViewProps(const PropsParserContext& context, const EventPropsNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props bool disabled{false}; @@ -596,6 +628,10 @@ class FloatPropsNativeComponentViewProps final : public ViewProps { FloatPropsNativeComponentViewProps() = default; FloatPropsNativeComponentViewProps(const PropsParserContext& context, const FloatPropsNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props Float blurRadius{0.0}; @@ -644,6 +680,10 @@ class ImagePropNativeComponentViewProps final : public ViewProps { ImagePropNativeComponentViewProps() = default; ImagePropNativeComponentViewProps(const PropsParserContext& context, const ImagePropNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props ImageSource thumbImage{}; @@ -685,6 +725,10 @@ class IntegerPropNativeComponentViewProps final : public ViewProps { IntegerPropNativeComponentViewProps() = default; IntegerPropNativeComponentViewProps(const PropsParserContext& context, const IntegerPropNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props int progress1{0}; @@ -728,6 +772,10 @@ class InterfaceOnlyNativeComponentViewProps final : public ViewProps { InterfaceOnlyNativeComponentViewProps() = default; InterfaceOnlyNativeComponentViewProps(const PropsParserContext& context, const InterfaceOnlyNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props std::string title{std::string{\\"\\"}}; @@ -769,6 +817,10 @@ class MixedPropNativeComponentViewProps final : public ViewProps { MixedPropNativeComponentViewProps() = default; MixedPropNativeComponentViewProps(const PropsParserContext& context, const MixedPropNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props folly::dynamic mixedProp{}; @@ -812,6 +864,10 @@ class MultiNativePropNativeComponentViewProps final : public ViewProps { MultiNativePropNativeComponentViewProps() = default; MultiNativePropNativeComponentViewProps(const PropsParserContext& context, const MultiNativePropNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props ImageSource thumbImage{}; @@ -856,6 +912,10 @@ class NoPropsNoEventsNativeComponentViewProps final : public ViewProps { NoPropsNoEventsNativeComponentViewProps() = default; NoPropsNoEventsNativeComponentViewProps(const PropsParserContext& context, const NoPropsNoEventsNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props @@ -1103,6 +1163,10 @@ class ObjectPropsNativeComponentProps final : public ViewProps { ObjectPropsNativeComponentProps() = default; ObjectPropsNativeComponentProps(const PropsParserContext& context, const ObjectPropsNativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props ObjectPropsNativeComponentObjectPropStruct objectProp{}; @@ -1147,6 +1211,10 @@ class PointPropNativeComponentViewProps final : public ViewProps { PointPropNativeComponentViewProps() = default; PointPropNativeComponentViewProps(const PropsParserContext& context, const PointPropNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props Point startPoint{}; @@ -1188,6 +1256,10 @@ class StringPropNativeComponentViewProps final : public ViewProps { StringPropNativeComponentViewProps() = default; StringPropNativeComponentViewProps(const PropsParserContext& context, const StringPropNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props std::string placeholder{std::string{\\"\\"}}; diff --git a/packages/react-native-codegen/e2e/namespaced/__tests__/components/__snapshots__/GeneratePropsCpp-test.js.snap b/packages/react-native-codegen/e2e/namespaced/__tests__/components/__snapshots__/GeneratePropsCpp-test.js.snap index 69900c4bba7b..2ac7ba9b59c9 100644 --- a/packages/react-native-codegen/e2e/namespaced/__tests__/components/__snapshots__/GeneratePropsCpp-test.js.snap +++ b/packages/react-native-codegen/e2e/namespaced/__tests__/components/__snapshots__/GeneratePropsCpp-test.js.snap @@ -37,6 +37,58 @@ ArrayPropsNativeComponentViewProps::ArrayPropsNativeComponentViewProps( object(convertRawProp(context, rawProps, \\"object\\", sourceProps.object, {})), arrayOfObjects(convertRawProp(context, rawProps, \\"arrayOfObjects\\", sourceProps.arrayOfObjects, {})), arrayOfMixed(convertRawProp(context, rawProps, \\"arrayOfMixed\\", sourceProps.arrayOfMixed, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void ArrayPropsNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"names\\"): + this->names = convertRawPropValuenames)>(propsParserContext, rawValue, \\"names\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"disableds\\"): + this->disableds = convertRawPropValuedisableds)>(propsParserContext, rawValue, \\"disableds\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"progress\\"): + this->progress = convertRawPropValueprogress)>(propsParserContext, rawValue, \\"progress\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"radii\\"): + this->radii = convertRawPropValueradii)>(propsParserContext, rawValue, \\"radii\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"colors\\"): + this->colors = convertRawPropValuecolors)>(propsParserContext, rawValue, \\"colors\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"srcs\\"): + this->srcs = convertRawPropValuesrcs)>(propsParserContext, rawValue, \\"srcs\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"points\\"): + this->points = convertRawPropValuepoints)>(propsParserContext, rawValue, \\"points\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"edgeInsets\\"): + this->edgeInsets = convertRawPropValueedgeInsets)>(propsParserContext, rawValue, \\"edgeInsets\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"dimensions\\"): + this->dimensions = convertRawPropValuedimensions)>(propsParserContext, rawValue, \\"dimensions\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"sizes\\"): + this->sizes = convertRawPropValue(propsParserContext, rawValue, \\"sizes\\", {static_cast(ArrayPropsNativeComponentViewSizes::Small)}).value; + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"object\\"): + this->object = convertRawPropValueobject)>(propsParserContext, rawValue, \\"object\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"arrayOfObjects\\"): + this->arrayOfObjects = convertRawPropValuearrayOfObjects)>(propsParserContext, rawValue, \\"arrayOfObjects\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"arrayOfMixed\\"): + this->arrayOfMixed = convertRawPropValuearrayOfMixed)>(propsParserContext, rawValue, \\"arrayOfMixed\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName ArrayPropsNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -138,6 +190,25 @@ BooleanPropNativeComponentViewProps::BooleanPropNativeComponentViewProps( disabled(convertRawProp(context, rawProps, \\"disabled\\", sourceProps.disabled, {false})), disabledNullable(convertRawProp(context, rawProps, \\"disabledNullable\\", sourceProps.disabledNullable, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void BooleanPropNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"disabled\\"): + this->disabled = convertRawPropValuedisabled)>(propsParserContext, rawValue, \\"disabled\\", {false}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"disabledNullable\\"): + this->disabledNullable = convertRawPropValuedisabledNullable)>(propsParserContext, rawValue, \\"disabledNullable\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName BooleanPropNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -194,6 +265,22 @@ ColorPropNativeComponentViewProps::ColorPropNativeComponentViewProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), tintColor(convertRawProp(context, rawProps, \\"tintColor\\", sourceProps.tintColor, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void ColorPropNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"tintColor\\"): + this->tintColor = convertRawPropValuetintColor)>(propsParserContext, rawValue, \\"tintColor\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName ColorPropNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -247,6 +334,22 @@ DimensionPropNativeComponentViewProps::DimensionPropNativeComponentViewProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), marginBack(convertRawProp(context, rawProps, \\"marginBack\\", sourceProps.marginBack, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void DimensionPropNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"marginBack\\"): + this->marginBack = convertRawPropValuemarginBack)>(propsParserContext, rawValue, \\"marginBack\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName DimensionPropNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -299,6 +402,16 @@ EdgeInsetsPropNativeComponentViewProps::EdgeInsetsPropNativeComponentViewProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void EdgeInsetsPropNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName EdgeInsetsPropNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -349,6 +462,25 @@ EnumPropNativeComponentViewProps::EnumPropNativeComponentViewProps( alignment(convertRawProp(context, rawProps, \\"alignment\\", sourceProps.alignment, {EnumPropNativeComponentViewAlignment::Center})), intervals(convertRawProp(context, rawProps, \\"intervals\\", sourceProps.intervals, {EnumPropNativeComponentViewIntervals::Intervals0})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void EnumPropNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"alignment\\"): + this->alignment = convertRawPropValuealignment)>(propsParserContext, rawValue, \\"alignment\\", {EnumPropNativeComponentViewAlignment::Center}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"intervals\\"): + this->intervals = convertRawPropValueintervals)>(propsParserContext, rawValue, \\"intervals\\", {EnumPropNativeComponentViewIntervals::Intervals0}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName EnumPropNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -405,6 +537,22 @@ EventNestedObjectPropsNativeComponentViewProps::EventNestedObjectPropsNativeComp const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), disabled(convertRawProp(context, rawProps, \\"disabled\\", sourceProps.disabled, {false})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void EventNestedObjectPropsNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"disabled\\"): + this->disabled = convertRawPropValuedisabled)>(propsParserContext, rawValue, \\"disabled\\", {false}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName EventNestedObjectPropsNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -457,6 +605,22 @@ EventPropsNativeComponentViewProps::EventPropsNativeComponentViewProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), disabled(convertRawProp(context, rawProps, \\"disabled\\", sourceProps.disabled, {false})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void EventPropsNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"disabled\\"): + this->disabled = convertRawPropValuedisabled)>(propsParserContext, rawValue, \\"disabled\\", {false}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName EventPropsNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -515,6 +679,40 @@ FloatPropsNativeComponentViewProps::FloatPropsNativeComponentViewProps( blurRadius5(convertRawProp(context, rawProps, \\"blurRadius5\\", sourceProps.blurRadius5, {1.0})), blurRadius6(convertRawProp(context, rawProps, \\"blurRadius6\\", sourceProps.blurRadius6, {0.0})), blurRadiusNullable(convertRawProp(context, rawProps, \\"blurRadiusNullable\\", sourceProps.blurRadiusNullable, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void FloatPropsNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"blurRadius\\"): + this->blurRadius = convertRawPropValueblurRadius)>(propsParserContext, rawValue, \\"blurRadius\\", {0.0}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"blurRadius2\\"): + this->blurRadius2 = convertRawPropValueblurRadius2)>(propsParserContext, rawValue, \\"blurRadius2\\", {0.001}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"blurRadius3\\"): + this->blurRadius3 = convertRawPropValueblurRadius3)>(propsParserContext, rawValue, \\"blurRadius3\\", {2.1}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"blurRadius4\\"): + this->blurRadius4 = convertRawPropValueblurRadius4)>(propsParserContext, rawValue, \\"blurRadius4\\", {0.0}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"blurRadius5\\"): + this->blurRadius5 = convertRawPropValueblurRadius5)>(propsParserContext, rawValue, \\"blurRadius5\\", {1.0}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"blurRadius6\\"): + this->blurRadius6 = convertRawPropValueblurRadius6)>(propsParserContext, rawValue, \\"blurRadius6\\", {0.0}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"blurRadiusNullable\\"): + this->blurRadiusNullable = convertRawPropValueblurRadiusNullable)>(propsParserContext, rawValue, \\"blurRadiusNullable\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName FloatPropsNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -592,6 +790,22 @@ ImagePropNativeComponentViewProps::ImagePropNativeComponentViewProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), thumbImage(convertRawProp(context, rawProps, \\"thumbImage\\", sourceProps.thumbImage, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void ImagePropNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"thumbImage\\"): + this->thumbImage = convertRawPropValuethumbImage)>(propsParserContext, rawValue, \\"thumbImage\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName ImagePropNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -646,6 +860,28 @@ IntegerPropNativeComponentViewProps::IntegerPropNativeComponentViewProps( progress1(convertRawProp(context, rawProps, \\"progress1\\", sourceProps.progress1, {0})), progress2(convertRawProp(context, rawProps, \\"progress2\\", sourceProps.progress2, {-1})), progress3(convertRawProp(context, rawProps, \\"progress3\\", sourceProps.progress3, {10})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void IntegerPropNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"progress1\\"): + this->progress1 = convertRawPropValueprogress1)>(propsParserContext, rawValue, \\"progress1\\", {0}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"progress2\\"): + this->progress2 = convertRawPropValueprogress2)>(propsParserContext, rawValue, \\"progress2\\", {-1}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"progress3\\"): + this->progress3 = convertRawPropValueprogress3)>(propsParserContext, rawValue, \\"progress3\\", {10}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName IntegerPropNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -706,6 +942,22 @@ InterfaceOnlyNativeComponentViewProps::InterfaceOnlyNativeComponentViewProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), title(convertRawProp(context, rawProps, \\"title\\", sourceProps.title, {std::string{\\"\\"}})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void InterfaceOnlyNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"title\\"): + this->title = convertRawPropValuetitle)>(propsParserContext, rawValue, \\"title\\", {std::string{\\"\\"}}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName InterfaceOnlyNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -759,6 +1011,22 @@ MixedPropNativeComponentViewProps::MixedPropNativeComponentViewProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), mixedProp(convertRawProp(context, rawProps, \\"mixedProp\\", sourceProps.mixedProp, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void MixedPropNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"mixedProp\\"): + this->mixedProp = convertRawPropValuemixedProp)>(propsParserContext, rawValue, \\"mixedProp\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName MixedPropNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -815,6 +1083,31 @@ MultiNativePropNativeComponentViewProps::MultiNativePropNativeComponentViewProps color(convertRawProp(context, rawProps, \\"color\\", sourceProps.color, {})), thumbTintColor(convertRawProp(context, rawProps, \\"thumbTintColor\\", sourceProps.thumbTintColor, {})), point(convertRawProp(context, rawProps, \\"point\\", sourceProps.point, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void MultiNativePropNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"thumbImage\\"): + this->thumbImage = convertRawPropValuethumbImage)>(propsParserContext, rawValue, \\"thumbImage\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"color\\"): + this->color = convertRawPropValuecolor)>(propsParserContext, rawValue, \\"color\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"thumbTintColor\\"): + this->thumbTintColor = convertRawPropValuethumbTintColor)>(propsParserContext, rawValue, \\"thumbTintColor\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"point\\"): + this->point = convertRawPropValuepoint)>(propsParserContext, rawValue, \\"point\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName MultiNativePropNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -879,6 +1172,16 @@ NoPropsNoEventsNativeComponentViewProps::NoPropsNoEventsNativeComponentViewProps const RawProps &rawProps): ViewProps(context, sourceProps, rawProps) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void NoPropsNoEventsNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName NoPropsNoEventsNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -931,6 +1234,28 @@ ObjectPropsNativeComponentProps::ObjectPropsNativeComponentProps( objectProp(convertRawProp(context, rawProps, \\"objectProp\\", sourceProps.objectProp, {})), objectArrayProp(convertRawProp(context, rawProps, \\"objectArrayProp\\", sourceProps.objectArrayProp, {})), objectPrimitiveRequiredProp(convertRawProp(context, rawProps, \\"objectPrimitiveRequiredProp\\", sourceProps.objectPrimitiveRequiredProp, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void ObjectPropsNativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"objectProp\\"): + this->objectProp = convertRawPropValueobjectProp)>(propsParserContext, rawValue, \\"objectProp\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"objectArrayProp\\"): + this->objectArrayProp = convertRawPropValueobjectArrayProp)>(propsParserContext, rawValue, \\"objectArrayProp\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"objectPrimitiveRequiredProp\\"): + this->objectPrimitiveRequiredProp = convertRawPropValueobjectPrimitiveRequiredProp)>(propsParserContext, rawValue, \\"objectPrimitiveRequiredProp\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName ObjectPropsNativeComponentProps::getDiffPropsImplementationTarget() const { @@ -991,6 +1316,22 @@ PointPropNativeComponentViewProps::PointPropNativeComponentViewProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), startPoint(convertRawProp(context, rawProps, \\"startPoint\\", sourceProps.startPoint, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void PointPropNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"startPoint\\"): + this->startPoint = convertRawPropValuestartPoint)>(propsParserContext, rawValue, \\"startPoint\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName PointPropNativeComponentViewProps::getDiffPropsImplementationTarget() const { @@ -1044,6 +1385,25 @@ StringPropNativeComponentViewProps::StringPropNativeComponentViewProps( placeholder(convertRawProp(context, rawProps, \\"placeholder\\", sourceProps.placeholder, {std::string{\\"\\"}})), defaultValue(convertRawProp(context, rawProps, \\"defaultValue\\", sourceProps.defaultValue, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void StringPropNativeComponentViewProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"placeholder\\"): + this->placeholder = convertRawPropValueplaceholder)>(propsParserContext, rawValue, \\"placeholder\\", {std::string{\\"\\"}}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"defaultValue\\"): + this->defaultValue = convertRawPropValuedefaultValue)>(propsParserContext, rawValue, \\"defaultValue\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName StringPropNativeComponentViewProps::getDiffPropsImplementationTarget() const { diff --git a/packages/react-native-codegen/e2e/namespaced/__tests__/components/__snapshots__/GeneratePropsH-test.js.snap b/packages/react-native-codegen/e2e/namespaced/__tests__/components/__snapshots__/GeneratePropsH-test.js.snap index 24078ff9fe2b..acd65f9e2d5e 100644 --- a/packages/react-native-codegen/e2e/namespaced/__tests__/components/__snapshots__/GeneratePropsH-test.js.snap +++ b/packages/react-native-codegen/e2e/namespaced/__tests__/components/__snapshots__/GeneratePropsH-test.js.snap @@ -26,7 +26,7 @@ namespace facebook::react { using ArrayPropsNativeComponentViewSizesMask = uint32_t; struct ArrayPropsNativeComponentViewSizesMaskWrapped { - ArrayPropsNativeComponentViewSizesMask value; + ArrayPropsNativeComponentViewSizesMask value{}; }; enum class ArrayPropsNativeComponentViewSizes: ArrayPropsNativeComponentViewSizesMask { @@ -180,6 +180,10 @@ class ArrayPropsNativeComponentViewProps final : public ViewProps { ArrayPropsNativeComponentViewProps() = default; ArrayPropsNativeComponentViewProps(const PropsParserContext& context, const ArrayPropsNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props std::vector names{}; @@ -233,6 +237,10 @@ class BooleanPropNativeComponentViewProps final : public ViewProps { BooleanPropNativeComponentViewProps() = default; BooleanPropNativeComponentViewProps(const PropsParserContext& context, const BooleanPropNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props bool disabled{false}; @@ -276,6 +284,10 @@ class ColorPropNativeComponentViewProps final : public ViewProps { ColorPropNativeComponentViewProps() = default; ColorPropNativeComponentViewProps(const PropsParserContext& context, const ColorPropNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props SharedColor tintColor{}; @@ -318,6 +330,10 @@ class DimensionPropNativeComponentViewProps final : public ViewProps { DimensionPropNativeComponentViewProps() = default; DimensionPropNativeComponentViewProps(const PropsParserContext& context, const DimensionPropNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props YGValue marginBack{}; @@ -359,6 +375,10 @@ class EdgeInsetsPropNativeComponentViewProps final : public ViewProps { EdgeInsetsPropNativeComponentViewProps() = default; EdgeInsetsPropNativeComponentViewProps(const PropsParserContext& context, const EdgeInsetsPropNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props @@ -472,6 +492,10 @@ class EnumPropNativeComponentViewProps final : public ViewProps { EnumPropNativeComponentViewProps() = default; EnumPropNativeComponentViewProps(const PropsParserContext& context, const EnumPropNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props EnumPropNativeComponentViewAlignment alignment{EnumPropNativeComponentViewAlignment::Center}; @@ -514,6 +538,10 @@ class EventNestedObjectPropsNativeComponentViewProps final : public ViewProps { EventNestedObjectPropsNativeComponentViewProps() = default; EventNestedObjectPropsNativeComponentViewProps(const PropsParserContext& context, const EventNestedObjectPropsNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props bool disabled{false}; @@ -555,6 +583,10 @@ class EventPropsNativeComponentViewProps final : public ViewProps { EventPropsNativeComponentViewProps() = default; EventPropsNativeComponentViewProps(const PropsParserContext& context, const EventPropsNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props bool disabled{false}; @@ -596,6 +628,10 @@ class FloatPropsNativeComponentViewProps final : public ViewProps { FloatPropsNativeComponentViewProps() = default; FloatPropsNativeComponentViewProps(const PropsParserContext& context, const FloatPropsNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props Float blurRadius{0.0}; @@ -644,6 +680,10 @@ class ImagePropNativeComponentViewProps final : public ViewProps { ImagePropNativeComponentViewProps() = default; ImagePropNativeComponentViewProps(const PropsParserContext& context, const ImagePropNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props ImageSource thumbImage{}; @@ -685,6 +725,10 @@ class IntegerPropNativeComponentViewProps final : public ViewProps { IntegerPropNativeComponentViewProps() = default; IntegerPropNativeComponentViewProps(const PropsParserContext& context, const IntegerPropNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props int progress1{0}; @@ -728,6 +772,10 @@ class InterfaceOnlyNativeComponentViewProps final : public ViewProps { InterfaceOnlyNativeComponentViewProps() = default; InterfaceOnlyNativeComponentViewProps(const PropsParserContext& context, const InterfaceOnlyNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props std::string title{std::string{\\"\\"}}; @@ -769,6 +817,10 @@ class MixedPropNativeComponentViewProps final : public ViewProps { MixedPropNativeComponentViewProps() = default; MixedPropNativeComponentViewProps(const PropsParserContext& context, const MixedPropNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props folly::dynamic mixedProp{}; @@ -812,6 +864,10 @@ class MultiNativePropNativeComponentViewProps final : public ViewProps { MultiNativePropNativeComponentViewProps() = default; MultiNativePropNativeComponentViewProps(const PropsParserContext& context, const MultiNativePropNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props ImageSource thumbImage{}; @@ -856,6 +912,10 @@ class NoPropsNoEventsNativeComponentViewProps final : public ViewProps { NoPropsNoEventsNativeComponentViewProps() = default; NoPropsNoEventsNativeComponentViewProps(const PropsParserContext& context, const NoPropsNoEventsNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props @@ -1103,6 +1163,10 @@ class ObjectPropsNativeComponentProps final : public ViewProps { ObjectPropsNativeComponentProps() = default; ObjectPropsNativeComponentProps(const PropsParserContext& context, const ObjectPropsNativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props ObjectPropsNativeComponentObjectPropStruct objectProp{}; @@ -1147,6 +1211,10 @@ class PointPropNativeComponentViewProps final : public ViewProps { PointPropNativeComponentViewProps() = default; PointPropNativeComponentViewProps(const PropsParserContext& context, const PointPropNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props Point startPoint{}; @@ -1188,6 +1256,10 @@ class StringPropNativeComponentViewProps final : public ViewProps { StringPropNativeComponentViewProps() = default; StringPropNativeComponentViewProps(const PropsParserContext& context, const StringPropNativeComponentViewProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props std::string placeholder{std::string{\\"\\"}}; diff --git a/packages/react-native-codegen/src/generators/components/GeneratePropsCpp.js b/packages/react-native-codegen/src/generators/components/GeneratePropsCpp.js index 10be5d254755..461b2437844c 100644 --- a/packages/react-native-codegen/src/generators/components/GeneratePropsCpp.js +++ b/packages/react-native-codegen/src/generators/components/GeneratePropsCpp.js @@ -12,9 +12,11 @@ import type {ComponentShape, SchemaType} from '../../CodegenSchema'; +const {getEnumName} = require('../Utils'); const { IncludeTemplate, convertDefaultTypeToString, + getEnumMaskName, getImports, getSourceProp, isWrappedPropType, @@ -55,11 +57,13 @@ const ComponentTemplate = ({ className, extendClasses, props, + setProp, diffProps, }: { className: string, extendClasses: string, props: string, + setProp: string, diffProps: string, }) => ` @@ -69,10 +73,40 @@ ${className}::${className}( const RawProps &rawProps):${extendClasses} ${props} {} + +${setProp} ${diffProps} `.trim(); +const SetPropTemplate = ({ + className, + baseSetProps, + cases, +}: { + className: string, + baseSetProps: string, + cases: string, +}) => + ` +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void ${className}::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { +${baseSetProps}${ + cases.length > 0 + ? ` + + switch (propNameHash) { +${cases} + }` + : '' + } +} +#endif`.trim(); + function generatePropsDiffString( className: string, componentName: string, @@ -259,6 +293,52 @@ function generatePropsString(componentName: string, component: ComponentShape) { .join(',\n' + ' '); } +// Sets each prop to the value the constructor's `convertRawProp` gives it, so +// the iterator-setter path (`enableCppPropsIteratorSetter`) builds the same +// props as the constructor. The parameters are not named `context` or `value`, +// which are prop names (`Switch` has a `value` prop), and fields are written +// through `this->` so that a prop named like a parameter still works. +function generateSetPropString( + className: string, + componentName: string, + component: ComponentShape, +): string { + const baseSetProps = component.extendsProps + .map(extendProps => { + switch (extendProps.type) { + case 'ReactNativeBuiltInType': + switch (extendProps.knownTypeName) { + case 'ReactNativeCoreViewProps': + return ' ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue);'; + default: + extendProps.knownTypeName as empty; + throw new Error('Invalid knownTypeName'); + } + default: + extendProps.type as empty; + throw new Error('Invalid extended type'); + } + }) + .join('\n'); + + const cases = component.props + .map(prop => { + const defaultValue = convertDefaultTypeToString(componentName, prop); + const field = `this->${prop.name}`; + // Same type and default as the constructor's `convertRawProp`. + const valueType = isWrappedPropType(prop) + ? `${getEnumMaskName(getEnumName(componentName, prop.name))}Wrapped` + : `decltype(${field})`; + const unwrap = isWrappedPropType(prop) ? '.value' : ''; + return ` case CONSTEXPR_RAW_PROPS_KEY_HASH("${prop.name}"): + ${field} = convertRawPropValue<${valueType}>(propsParserContext, rawValue, "${prop.name}", {${defaultValue}})${unwrap}; + return;`; + }) + .join('\n'); + + return SetPropTemplate({className, baseSetProps, cases}); +} + function generateDebugPropsString( componentName: string, component: ComponentShape, @@ -343,6 +423,11 @@ module.exports = { const propsString = generatePropsString(componentName, component); const extendString = getClassExtendString(component); + const setPropString = generateSetPropString( + newName, + componentName, + component, + ); const debugProps = includeGetDebugPropsImplementation ? generateDebugPropsString(componentName, component) : ''; @@ -362,6 +447,7 @@ module.exports = { className: newName, extendClasses: extendString, props: propsString, + setProp: setPropString, diffProps: diffPropsString, }); diff --git a/packages/react-native-codegen/src/generators/components/GeneratePropsH.js b/packages/react-native-codegen/src/generators/components/GeneratePropsH.js index 0729cdd04bdc..7d6835ed9de0 100644 --- a/packages/react-native-codegen/src/generators/components/GeneratePropsH.js +++ b/packages/react-native-codegen/src/generators/components/GeneratePropsH.js @@ -87,6 +87,10 @@ class ${className} final${extendClasses} { ${className}() = default; ${className}(const PropsParserContext& context, const ${className} &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props ${props} @@ -277,7 +281,7 @@ const ArrayEnumTemplate = ({ using ${enumMask} = uint32_t; struct ${enumMask}Wrapped { - ${enumMask} value; + ${enumMask} value{}; }; enum class ${enumName}: ${enumMask} { diff --git a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsCpp-test.js.snap b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsCpp-test.js.snap index c90a4639fa53..cd086d74d580 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsCpp-test.js.snap +++ b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsCpp-test.js.snap @@ -40,6 +40,70 @@ AllPropProps::AllPropProps( objectPrimitiveRequiredProp(convertRawProp(context, rawProps, \\"objectPrimitiveRequiredProp\\", sourceProps.objectPrimitiveRequiredProp, {})), nestedPropA(convertRawProp(context, rawProps, \\"nestedPropA\\", sourceProps.nestedPropA, {})), nestedArrayAsProperty(convertRawProp(context, rawProps, \\"nestedArrayAsProperty\\", sourceProps.nestedArrayAsProperty, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void AllPropProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"stringPropNoDefault\\"): + this->stringPropNoDefault = convertRawPropValuestringPropNoDefault)>(propsParserContext, rawValue, \\"stringPropNoDefault\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"booleanPropNoDefault\\"): + this->booleanPropNoDefault = convertRawPropValuebooleanPropNoDefault)>(propsParserContext, rawValue, \\"booleanPropNoDefault\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"floatPropNoDefault\\"): + this->floatPropNoDefault = convertRawPropValuefloatPropNoDefault)>(propsParserContext, rawValue, \\"floatPropNoDefault\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"stringProp\\"): + this->stringProp = convertRawPropValuestringProp)>(propsParserContext, rawValue, \\"stringProp\\", {std::string{\\"\\"}}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"booleanProp\\"): + this->booleanProp = convertRawPropValuebooleanProp)>(propsParserContext, rawValue, \\"booleanProp\\", {false}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"floatProp\\"): + this->floatProp = convertRawPropValuefloatProp)>(propsParserContext, rawValue, \\"floatProp\\", {0.0}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"intProp\\"): + this->intProp = convertRawPropValueintProp)>(propsParserContext, rawValue, \\"intProp\\", {0}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"stringUserDefaultProp\\"): + this->stringUserDefaultProp = convertRawPropValuestringUserDefaultProp)>(propsParserContext, rawValue, \\"stringUserDefaultProp\\", {std::string{\\"user_default\\"}}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"booleanUserDefaultProp\\"): + this->booleanUserDefaultProp = convertRawPropValuebooleanUserDefaultProp)>(propsParserContext, rawValue, \\"booleanUserDefaultProp\\", {true}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"floatUserDefaultProp\\"): + this->floatUserDefaultProp = convertRawPropValuefloatUserDefaultProp)>(propsParserContext, rawValue, \\"floatUserDefaultProp\\", {3.14}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"intUserDefaultProp\\"): + this->intUserDefaultProp = convertRawPropValueintUserDefaultProp)>(propsParserContext, rawValue, \\"intUserDefaultProp\\", {9999}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"stringEnumProp\\"): + this->stringEnumProp = convertRawPropValuestringEnumProp)>(propsParserContext, rawValue, \\"stringEnumProp\\", {AllPropStringEnumProp::Option1}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"intEnumProp\\"): + this->intEnumProp = convertRawPropValueintEnumProp)>(propsParserContext, rawValue, \\"intEnumProp\\", {AllPropIntEnumProp::IntEnumProp0}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"objectArrayProp\\"): + this->objectArrayProp = convertRawPropValueobjectArrayProp)>(propsParserContext, rawValue, \\"objectArrayProp\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"objectPrimitiveRequiredProp\\"): + this->objectPrimitiveRequiredProp = convertRawPropValueobjectPrimitiveRequiredProp)>(propsParserContext, rawValue, \\"objectPrimitiveRequiredProp\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"nestedPropA\\"): + this->nestedPropA = convertRawPropValuenestedPropA)>(propsParserContext, rawValue, \\"nestedPropA\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"nestedArrayAsProperty\\"): + this->nestedArrayAsProperty = convertRawPropValuenestedArrayAsProperty)>(propsParserContext, rawValue, \\"nestedArrayAsProperty\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName AllPropProps::getDiffPropsImplementationTarget() const { @@ -173,6 +237,70 @@ AllPropWithOptionalGenProps::AllPropWithOptionalGenProps( objectPrimitiveRequiredProp(convertRawProp(context, rawProps, \\"objectPrimitiveRequiredProp\\", sourceProps.objectPrimitiveRequiredProp, {})), nestedPropA(convertRawProp(context, rawProps, \\"nestedPropA\\", sourceProps.nestedPropA, {})), nestedArrayAsProperty(convertRawProp(context, rawProps, \\"nestedArrayAsProperty\\", sourceProps.nestedArrayAsProperty, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void AllPropWithOptionalGenProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"stringPropNoDefault\\"): + this->stringPropNoDefault = convertRawPropValuestringPropNoDefault)>(propsParserContext, rawValue, \\"stringPropNoDefault\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"booleanPropNoDefault\\"): + this->booleanPropNoDefault = convertRawPropValuebooleanPropNoDefault)>(propsParserContext, rawValue, \\"booleanPropNoDefault\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"floatPropNoDefault\\"): + this->floatPropNoDefault = convertRawPropValuefloatPropNoDefault)>(propsParserContext, rawValue, \\"floatPropNoDefault\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"stringProp\\"): + this->stringProp = convertRawPropValuestringProp)>(propsParserContext, rawValue, \\"stringProp\\", {std::string{\\"\\"}}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"booleanProp\\"): + this->booleanProp = convertRawPropValuebooleanProp)>(propsParserContext, rawValue, \\"booleanProp\\", {false}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"floatProp\\"): + this->floatProp = convertRawPropValuefloatProp)>(propsParserContext, rawValue, \\"floatProp\\", {0.0}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"intProp\\"): + this->intProp = convertRawPropValueintProp)>(propsParserContext, rawValue, \\"intProp\\", {0}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"stringUserDefaultProp\\"): + this->stringUserDefaultProp = convertRawPropValuestringUserDefaultProp)>(propsParserContext, rawValue, \\"stringUserDefaultProp\\", {std::string{\\"user_default\\"}}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"booleanUserDefaultProp\\"): + this->booleanUserDefaultProp = convertRawPropValuebooleanUserDefaultProp)>(propsParserContext, rawValue, \\"booleanUserDefaultProp\\", {true}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"floatUserDefaultProp\\"): + this->floatUserDefaultProp = convertRawPropValuefloatUserDefaultProp)>(propsParserContext, rawValue, \\"floatUserDefaultProp\\", {3.14}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"intUserDefaultProp\\"): + this->intUserDefaultProp = convertRawPropValueintUserDefaultProp)>(propsParserContext, rawValue, \\"intUserDefaultProp\\", {9999}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"stringEnumProp\\"): + this->stringEnumProp = convertRawPropValuestringEnumProp)>(propsParserContext, rawValue, \\"stringEnumProp\\", {AllPropWithOptionalGenStringEnumProp::Option1}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"intEnumProp\\"): + this->intEnumProp = convertRawPropValueintEnumProp)>(propsParserContext, rawValue, \\"intEnumProp\\", {AllPropWithOptionalGenIntEnumProp::IntEnumProp0}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"objectArrayProp\\"): + this->objectArrayProp = convertRawPropValueobjectArrayProp)>(propsParserContext, rawValue, \\"objectArrayProp\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"objectPrimitiveRequiredProp\\"): + this->objectPrimitiveRequiredProp = convertRawPropValueobjectPrimitiveRequiredProp)>(propsParserContext, rawValue, \\"objectPrimitiveRequiredProp\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"nestedPropA\\"): + this->nestedPropA = convertRawPropValuenestedPropA)>(propsParserContext, rawValue, \\"nestedPropA\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"nestedArrayAsProperty\\"): + this->nestedArrayAsProperty = convertRawPropValuenestedArrayAsProperty)>(propsParserContext, rawValue, \\"nestedArrayAsProperty\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName AllPropWithOptionalGenProps::getDiffPropsImplementationTarget() const { @@ -320,6 +448,70 @@ AllPropWithOptionalObjectGenProps::AllPropWithOptionalObjectGenProps( objectPrimitiveRequiredProp(convertRawProp(context, rawProps, \\"objectPrimitiveRequiredProp\\", sourceProps.objectPrimitiveRequiredProp, {})), nestedPropA(convertRawProp(context, rawProps, \\"nestedPropA\\", sourceProps.nestedPropA, {})), nestedArrayAsProperty(convertRawProp(context, rawProps, \\"nestedArrayAsProperty\\", sourceProps.nestedArrayAsProperty, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void AllPropWithOptionalObjectGenProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"stringPropNoDefault\\"): + this->stringPropNoDefault = convertRawPropValuestringPropNoDefault)>(propsParserContext, rawValue, \\"stringPropNoDefault\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"booleanPropNoDefault\\"): + this->booleanPropNoDefault = convertRawPropValuebooleanPropNoDefault)>(propsParserContext, rawValue, \\"booleanPropNoDefault\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"floatPropNoDefault\\"): + this->floatPropNoDefault = convertRawPropValuefloatPropNoDefault)>(propsParserContext, rawValue, \\"floatPropNoDefault\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"stringProp\\"): + this->stringProp = convertRawPropValuestringProp)>(propsParserContext, rawValue, \\"stringProp\\", {std::string{\\"\\"}}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"booleanProp\\"): + this->booleanProp = convertRawPropValuebooleanProp)>(propsParserContext, rawValue, \\"booleanProp\\", {false}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"floatProp\\"): + this->floatProp = convertRawPropValuefloatProp)>(propsParserContext, rawValue, \\"floatProp\\", {0.0}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"intProp\\"): + this->intProp = convertRawPropValueintProp)>(propsParserContext, rawValue, \\"intProp\\", {0}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"stringUserDefaultProp\\"): + this->stringUserDefaultProp = convertRawPropValuestringUserDefaultProp)>(propsParserContext, rawValue, \\"stringUserDefaultProp\\", {std::string{\\"user_default\\"}}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"booleanUserDefaultProp\\"): + this->booleanUserDefaultProp = convertRawPropValuebooleanUserDefaultProp)>(propsParserContext, rawValue, \\"booleanUserDefaultProp\\", {true}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"floatUserDefaultProp\\"): + this->floatUserDefaultProp = convertRawPropValuefloatUserDefaultProp)>(propsParserContext, rawValue, \\"floatUserDefaultProp\\", {3.14}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"intUserDefaultProp\\"): + this->intUserDefaultProp = convertRawPropValueintUserDefaultProp)>(propsParserContext, rawValue, \\"intUserDefaultProp\\", {9999}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"stringEnumProp\\"): + this->stringEnumProp = convertRawPropValuestringEnumProp)>(propsParserContext, rawValue, \\"stringEnumProp\\", {AllPropWithOptionalObjectGenStringEnumProp::Option1}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"intEnumProp\\"): + this->intEnumProp = convertRawPropValueintEnumProp)>(propsParserContext, rawValue, \\"intEnumProp\\", {AllPropWithOptionalObjectGenIntEnumProp::IntEnumProp0}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"objectArrayProp\\"): + this->objectArrayProp = convertRawPropValueobjectArrayProp)>(propsParserContext, rawValue, \\"objectArrayProp\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"objectPrimitiveRequiredProp\\"): + this->objectPrimitiveRequiredProp = convertRawPropValueobjectPrimitiveRequiredProp)>(propsParserContext, rawValue, \\"objectPrimitiveRequiredProp\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"nestedPropA\\"): + this->nestedPropA = convertRawPropValuenestedPropA)>(propsParserContext, rawValue, \\"nestedPropA\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"nestedArrayAsProperty\\"): + this->nestedArrayAsProperty = convertRawPropValuenestedArrayAsProperty)>(propsParserContext, rawValue, \\"nestedArrayAsProperty\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName AllPropWithOptionalObjectGenProps::getDiffPropsImplementationTarget() const { @@ -464,6 +656,58 @@ ArrayPropsNativeComponentProps::ArrayPropsNativeComponentProps( array(convertRawProp(context, rawProps, \\"array\\", sourceProps.array, {})), arrayOfArrayOfObject(convertRawProp(context, rawProps, \\"arrayOfArrayOfObject\\", sourceProps.arrayOfArrayOfObject, {})), arrayOfMixed(convertRawProp(context, rawProps, \\"arrayOfMixed\\", sourceProps.arrayOfMixed, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void ArrayPropsNativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"names\\"): + this->names = convertRawPropValuenames)>(propsParserContext, rawValue, \\"names\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"disableds\\"): + this->disableds = convertRawPropValuedisableds)>(propsParserContext, rawValue, \\"disableds\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"progress\\"): + this->progress = convertRawPropValueprogress)>(propsParserContext, rawValue, \\"progress\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"radii\\"): + this->radii = convertRawPropValueradii)>(propsParserContext, rawValue, \\"radii\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"colors\\"): + this->colors = convertRawPropValuecolors)>(propsParserContext, rawValue, \\"colors\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"srcs\\"): + this->srcs = convertRawPropValuesrcs)>(propsParserContext, rawValue, \\"srcs\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"points\\"): + this->points = convertRawPropValuepoints)>(propsParserContext, rawValue, \\"points\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"dimensions\\"): + this->dimensions = convertRawPropValuedimensions)>(propsParserContext, rawValue, \\"dimensions\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"sizes\\"): + this->sizes = convertRawPropValue(propsParserContext, rawValue, \\"sizes\\", {static_cast(ArrayPropsNativeComponentSizes::Small)}).value; + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"object\\"): + this->object = convertRawPropValueobject)>(propsParserContext, rawValue, \\"object\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"array\\"): + this->array = convertRawPropValuearray)>(propsParserContext, rawValue, \\"array\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"arrayOfArrayOfObject\\"): + this->arrayOfArrayOfObject = convertRawPropValuearrayOfArrayOfObject)>(propsParserContext, rawValue, \\"arrayOfArrayOfObject\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"arrayOfMixed\\"): + this->arrayOfMixed = convertRawPropValuearrayOfMixed)>(propsParserContext, rawValue, \\"arrayOfMixed\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName ArrayPropsNativeComponentProps::getDiffPropsImplementationTarget() const { @@ -564,6 +808,22 @@ ArrayPropsNativeComponentProps::ArrayPropsNativeComponentProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), nativePrimitives(convertRawProp(context, rawProps, \\"nativePrimitives\\", sourceProps.nativePrimitives, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void ArrayPropsNativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"nativePrimitives\\"): + this->nativePrimitives = convertRawPropValuenativePrimitives)>(propsParserContext, rawValue, \\"nativePrimitives\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName ArrayPropsNativeComponentProps::getDiffPropsImplementationTarget() const { @@ -616,6 +876,22 @@ ArrayPropsOptionalGenNativeComponentProps::ArrayPropsOptionalGenNativeComponentP const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), nativePrimitives(convertRawProp(context, rawProps, \\"nativePrimitives\\", sourceProps.nativePrimitives, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void ArrayPropsOptionalGenNativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"nativePrimitives\\"): + this->nativePrimitives = convertRawPropValuenativePrimitives)>(propsParserContext, rawValue, \\"nativePrimitives\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName ArrayPropsOptionalGenNativeComponentProps::getDiffPropsImplementationTarget() const { @@ -672,6 +948,22 @@ ArrayPropsOptionalObjectGenNativeComponentProps::ArrayPropsOptionalObjectGenNati const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), nativePrimitives(convertRawProp(context, rawProps, \\"nativePrimitives\\", sourceProps.nativePrimitives, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void ArrayPropsOptionalObjectGenNativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"nativePrimitives\\"): + this->nativePrimitives = convertRawPropValuenativePrimitives)>(propsParserContext, rawValue, \\"nativePrimitives\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName ArrayPropsOptionalObjectGenNativeComponentProps::getDiffPropsImplementationTarget() const { @@ -742,6 +1034,58 @@ ArrayPropsWithOptionalGenNativeComponentProps::ArrayPropsWithOptionalGenNativeCo array(convertRawProp(context, rawProps, \\"array\\", sourceProps.array, {})), arrayOfArrayOfObject(convertRawProp(context, rawProps, \\"arrayOfArrayOfObject\\", sourceProps.arrayOfArrayOfObject, {})), arrayOfMixed(convertRawProp(context, rawProps, \\"arrayOfMixed\\", sourceProps.arrayOfMixed, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void ArrayPropsWithOptionalGenNativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"names\\"): + this->names = convertRawPropValuenames)>(propsParserContext, rawValue, \\"names\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"disableds\\"): + this->disableds = convertRawPropValuedisableds)>(propsParserContext, rawValue, \\"disableds\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"progress\\"): + this->progress = convertRawPropValueprogress)>(propsParserContext, rawValue, \\"progress\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"radii\\"): + this->radii = convertRawPropValueradii)>(propsParserContext, rawValue, \\"radii\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"colors\\"): + this->colors = convertRawPropValuecolors)>(propsParserContext, rawValue, \\"colors\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"srcs\\"): + this->srcs = convertRawPropValuesrcs)>(propsParserContext, rawValue, \\"srcs\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"points\\"): + this->points = convertRawPropValuepoints)>(propsParserContext, rawValue, \\"points\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"dimensions\\"): + this->dimensions = convertRawPropValuedimensions)>(propsParserContext, rawValue, \\"dimensions\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"sizes\\"): + this->sizes = convertRawPropValue(propsParserContext, rawValue, \\"sizes\\", {static_cast(ArrayPropsWithOptionalGenNativeComponentSizes::Small)}).value; + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"object\\"): + this->object = convertRawPropValueobject)>(propsParserContext, rawValue, \\"object\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"array\\"): + this->array = convertRawPropValuearray)>(propsParserContext, rawValue, \\"array\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"arrayOfArrayOfObject\\"): + this->arrayOfArrayOfObject = convertRawPropValuearrayOfArrayOfObject)>(propsParserContext, rawValue, \\"arrayOfArrayOfObject\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"arrayOfMixed\\"): + this->arrayOfMixed = convertRawPropValuearrayOfMixed)>(propsParserContext, rawValue, \\"arrayOfMixed\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName ArrayPropsWithOptionalGenNativeComponentProps::getDiffPropsImplementationTarget() const { @@ -908,6 +1252,58 @@ ArrayPropsWithOptionalObjectGenNativeComponentProps::ArrayPropsWithOptionalObjec array(convertRawProp(context, rawProps, \\"array\\", sourceProps.array, {})), arrayOfArrayOfObject(convertRawProp(context, rawProps, \\"arrayOfArrayOfObject\\", sourceProps.arrayOfArrayOfObject, {})), arrayOfMixed(convertRawProp(context, rawProps, \\"arrayOfMixed\\", sourceProps.arrayOfMixed, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void ArrayPropsWithOptionalObjectGenNativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"names\\"): + this->names = convertRawPropValuenames)>(propsParserContext, rawValue, \\"names\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"disableds\\"): + this->disableds = convertRawPropValuedisableds)>(propsParserContext, rawValue, \\"disableds\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"progress\\"): + this->progress = convertRawPropValueprogress)>(propsParserContext, rawValue, \\"progress\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"radii\\"): + this->radii = convertRawPropValueradii)>(propsParserContext, rawValue, \\"radii\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"colors\\"): + this->colors = convertRawPropValuecolors)>(propsParserContext, rawValue, \\"colors\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"srcs\\"): + this->srcs = convertRawPropValuesrcs)>(propsParserContext, rawValue, \\"srcs\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"points\\"): + this->points = convertRawPropValuepoints)>(propsParserContext, rawValue, \\"points\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"dimensions\\"): + this->dimensions = convertRawPropValuedimensions)>(propsParserContext, rawValue, \\"dimensions\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"sizes\\"): + this->sizes = convertRawPropValue(propsParserContext, rawValue, \\"sizes\\", {static_cast(ArrayPropsWithOptionalObjectGenNativeComponentSizes::Small)}).value; + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"object\\"): + this->object = convertRawPropValueobject)>(propsParserContext, rawValue, \\"object\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"array\\"): + this->array = convertRawPropValuearray)>(propsParserContext, rawValue, \\"array\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"arrayOfArrayOfObject\\"): + this->arrayOfArrayOfObject = convertRawPropValuearrayOfArrayOfObject)>(propsParserContext, rawValue, \\"arrayOfArrayOfObject\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"arrayOfMixed\\"): + this->arrayOfMixed = convertRawPropValuearrayOfMixed)>(propsParserContext, rawValue, \\"arrayOfMixed\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName ArrayPropsWithOptionalObjectGenNativeComponentProps::getDiffPropsImplementationTarget() const { @@ -1060,6 +1456,22 @@ BooleanPropNativeComponentProps::BooleanPropNativeComponentProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), disabled(convertRawProp(context, rawProps, \\"disabled\\", sourceProps.disabled, {false})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void BooleanPropNativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"disabled\\"): + this->disabled = convertRawPropValuedisabled)>(propsParserContext, rawValue, \\"disabled\\", {false}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName BooleanPropNativeComponentProps::getDiffPropsImplementationTarget() const { @@ -1112,6 +1524,22 @@ ColorPropNativeComponentProps::ColorPropNativeComponentProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), tintColor(convertRawProp(context, rawProps, \\"tintColor\\", sourceProps.tintColor, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void ColorPropNativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"tintColor\\"): + this->tintColor = convertRawPropValuetintColor)>(propsParserContext, rawValue, \\"tintColor\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName ColorPropNativeComponentProps::getDiffPropsImplementationTarget() const { @@ -1164,6 +1592,16 @@ CommandNativeComponentProps::CommandNativeComponentProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void CommandNativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName CommandNativeComponentProps::getDiffPropsImplementationTarget() const { @@ -1213,6 +1651,22 @@ CommandNativeComponentProps::CommandNativeComponentProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), accessibilityHint(convertRawProp(context, rawProps, \\"accessibilityHint\\", sourceProps.accessibilityHint, {std::string{\\"\\"}})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void CommandNativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"accessibilityHint\\"): + this->accessibilityHint = convertRawPropValueaccessibilityHint)>(propsParserContext, rawValue, \\"accessibilityHint\\", {std::string{\\"\\"}}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName CommandNativeComponentProps::getDiffPropsImplementationTarget() const { @@ -1266,6 +1720,22 @@ DimensionPropNativeComponentProps::DimensionPropNativeComponentProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), marginBack(convertRawProp(context, rawProps, \\"marginBack\\", sourceProps.marginBack, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void DimensionPropNativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"marginBack\\"): + this->marginBack = convertRawPropValuemarginBack)>(propsParserContext, rawValue, \\"marginBack\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName DimensionPropNativeComponentProps::getDiffPropsImplementationTarget() const { @@ -1323,6 +1793,37 @@ DoublePropNativeComponentProps::DoublePropNativeComponentProps( blurRadius4(convertRawProp(context, rawProps, \\"blurRadius4\\", sourceProps.blurRadius4, {0.0})), blurRadius5(convertRawProp(context, rawProps, \\"blurRadius5\\", sourceProps.blurRadius5, {1.0})), blurRadius6(convertRawProp(context, rawProps, \\"blurRadius6\\", sourceProps.blurRadius6, {0.0})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void DoublePropNativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"blurRadius\\"): + this->blurRadius = convertRawPropValueblurRadius)>(propsParserContext, rawValue, \\"blurRadius\\", {0.0}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"blurRadius2\\"): + this->blurRadius2 = convertRawPropValueblurRadius2)>(propsParserContext, rawValue, \\"blurRadius2\\", {0.001}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"blurRadius3\\"): + this->blurRadius3 = convertRawPropValueblurRadius3)>(propsParserContext, rawValue, \\"blurRadius3\\", {2.1}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"blurRadius4\\"): + this->blurRadius4 = convertRawPropValueblurRadius4)>(propsParserContext, rawValue, \\"blurRadius4\\", {0.0}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"blurRadius5\\"): + this->blurRadius5 = convertRawPropValueblurRadius5)>(propsParserContext, rawValue, \\"blurRadius5\\", {1.0}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"blurRadius6\\"): + this->blurRadius6 = convertRawPropValueblurRadius6)>(propsParserContext, rawValue, \\"blurRadius6\\", {0.0}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName DoublePropNativeComponentProps::getDiffPropsImplementationTarget() const { @@ -1395,6 +1896,22 @@ EventsNestedObjectNativeComponentProps::EventsNestedObjectNativeComponentProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), disabled(convertRawProp(context, rawProps, \\"disabled\\", sourceProps.disabled, {false})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void EventsNestedObjectNativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"disabled\\"): + this->disabled = convertRawPropValuedisabled)>(propsParserContext, rawValue, \\"disabled\\", {false}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName EventsNestedObjectNativeComponentProps::getDiffPropsImplementationTarget() const { @@ -1447,6 +1964,22 @@ EventsNativeComponentProps::EventsNativeComponentProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), disabled(convertRawProp(context, rawProps, \\"disabled\\", sourceProps.disabled, {false})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void EventsNativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"disabled\\"): + this->disabled = convertRawPropValuedisabled)>(propsParserContext, rawValue, \\"disabled\\", {false}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName EventsNativeComponentProps::getDiffPropsImplementationTarget() const { @@ -1499,6 +2032,16 @@ InterfaceOnlyComponentProps::InterfaceOnlyComponentProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void InterfaceOnlyComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName InterfaceOnlyComponentProps::getDiffPropsImplementationTarget() const { @@ -1548,6 +2091,16 @@ ExcludedAndroidComponentProps::ExcludedAndroidComponentProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void ExcludedAndroidComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName ExcludedAndroidComponentProps::getDiffPropsImplementationTarget() const { @@ -1597,6 +2150,16 @@ ExcludedAndroidIosComponentProps::ExcludedAndroidIosComponentProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void ExcludedAndroidIosComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName ExcludedAndroidIosComponentProps::getDiffPropsImplementationTarget() const { @@ -1646,6 +2209,16 @@ ExcludedIosComponentProps::ExcludedIosComponentProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void ExcludedIosComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName ExcludedIosComponentProps::getDiffPropsImplementationTarget() const { @@ -1672,6 +2245,22 @@ MultiFileIncludedNativeComponentProps::MultiFileIncludedNativeComponentProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), disabled(convertRawProp(context, rawProps, \\"disabled\\", sourceProps.disabled, {true})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void MultiFileIncludedNativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"disabled\\"): + this->disabled = convertRawPropValuedisabled)>(propsParserContext, rawValue, \\"disabled\\", {true}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName MultiFileIncludedNativeComponentProps::getDiffPropsImplementationTarget() const { @@ -1729,6 +2318,37 @@ FloatPropNativeComponentProps::FloatPropNativeComponentProps( blurRadius4(convertRawProp(context, rawProps, \\"blurRadius4\\", sourceProps.blurRadius4, {0.0})), blurRadius5(convertRawProp(context, rawProps, \\"blurRadius5\\", sourceProps.blurRadius5, {1.0})), blurRadius6(convertRawProp(context, rawProps, \\"blurRadius6\\", sourceProps.blurRadius6, {0.0})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void FloatPropNativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"blurRadius\\"): + this->blurRadius = convertRawPropValueblurRadius)>(propsParserContext, rawValue, \\"blurRadius\\", {0.0}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"blurRadius2\\"): + this->blurRadius2 = convertRawPropValueblurRadius2)>(propsParserContext, rawValue, \\"blurRadius2\\", {0.001}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"blurRadius3\\"): + this->blurRadius3 = convertRawPropValueblurRadius3)>(propsParserContext, rawValue, \\"blurRadius3\\", {2.1}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"blurRadius4\\"): + this->blurRadius4 = convertRawPropValueblurRadius4)>(propsParserContext, rawValue, \\"blurRadius4\\", {0.0}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"blurRadius5\\"): + this->blurRadius5 = convertRawPropValueblurRadius5)>(propsParserContext, rawValue, \\"blurRadius5\\", {1.0}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"blurRadius6\\"): + this->blurRadius6 = convertRawPropValueblurRadius6)>(propsParserContext, rawValue, \\"blurRadius6\\", {0.0}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName FloatPropNativeComponentProps::getDiffPropsImplementationTarget() const { @@ -1802,6 +2422,22 @@ ImagePropNativeComponentProps::ImagePropNativeComponentProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), thumbImage(convertRawProp(context, rawProps, \\"thumbImage\\", sourceProps.thumbImage, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void ImagePropNativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"thumbImage\\"): + this->thumbImage = convertRawPropValuethumbImage)>(propsParserContext, rawValue, \\"thumbImage\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName ImagePropNativeComponentProps::getDiffPropsImplementationTarget() const { @@ -1854,6 +2490,22 @@ InsetsPropNativeComponentProps::InsetsPropNativeComponentProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), contentInset(convertRawProp(context, rawProps, \\"contentInset\\", sourceProps.contentInset, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void InsetsPropNativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"contentInset\\"): + this->contentInset = convertRawPropValuecontentInset)>(propsParserContext, rawValue, \\"contentInset\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName InsetsPropNativeComponentProps::getDiffPropsImplementationTarget() const { @@ -1906,6 +2558,22 @@ Int32EnumPropsNativeComponentProps::Int32EnumPropsNativeComponentProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), maxInterval(convertRawProp(context, rawProps, \\"maxInterval\\", sourceProps.maxInterval, {Int32EnumPropsNativeComponentMaxInterval::MaxInterval0})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void Int32EnumPropsNativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"maxInterval\\"): + this->maxInterval = convertRawPropValuemaxInterval)>(propsParserContext, rawValue, \\"maxInterval\\", {Int32EnumPropsNativeComponentMaxInterval::MaxInterval0}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName Int32EnumPropsNativeComponentProps::getDiffPropsImplementationTarget() const { @@ -1960,6 +2628,28 @@ IntegerPropNativeComponentProps::IntegerPropNativeComponentProps( progress1(convertRawProp(context, rawProps, \\"progress1\\", sourceProps.progress1, {0})), progress2(convertRawProp(context, rawProps, \\"progress2\\", sourceProps.progress2, {-1})), progress3(convertRawProp(context, rawProps, \\"progress3\\", sourceProps.progress3, {10})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void IntegerPropNativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"progress1\\"): + this->progress1 = convertRawPropValueprogress1)>(propsParserContext, rawValue, \\"progress1\\", {0}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"progress2\\"): + this->progress2 = convertRawPropValueprogress2)>(propsParserContext, rawValue, \\"progress2\\", {-1}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"progress3\\"): + this->progress3 = convertRawPropValueprogress3)>(propsParserContext, rawValue, \\"progress3\\", {10}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName IntegerPropNativeComponentProps::getDiffPropsImplementationTarget() const { @@ -2020,6 +2710,22 @@ InterfaceOnlyComponentProps::InterfaceOnlyComponentProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), accessibilityHint(convertRawProp(context, rawProps, \\"accessibilityHint\\", sourceProps.accessibilityHint, {std::string{\\"\\"}})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void InterfaceOnlyComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"accessibilityHint\\"): + this->accessibilityHint = convertRawPropValueaccessibilityHint)>(propsParserContext, rawValue, \\"accessibilityHint\\", {std::string{\\"\\"}}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName InterfaceOnlyComponentProps::getDiffPropsImplementationTarget() const { @@ -2073,6 +2779,22 @@ MixedPropNativeComponentProps::MixedPropNativeComponentProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), mixedProp(convertRawProp(context, rawProps, \\"mixedProp\\", sourceProps.mixedProp, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void MixedPropNativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"mixedProp\\"): + this->mixedProp = convertRawPropValuemixedProp)>(propsParserContext, rawValue, \\"mixedProp\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName MixedPropNativeComponentProps::getDiffPropsImplementationTarget() const { @@ -2129,6 +2851,31 @@ ImageColorPropNativeComponentProps::ImageColorPropNativeComponentProps( color(convertRawProp(context, rawProps, \\"color\\", sourceProps.color, {})), thumbTintColor(convertRawProp(context, rawProps, \\"thumbTintColor\\", sourceProps.thumbTintColor, {})), point(convertRawProp(context, rawProps, \\"point\\", sourceProps.point, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void ImageColorPropNativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"thumbImage\\"): + this->thumbImage = convertRawPropValuethumbImage)>(propsParserContext, rawValue, \\"thumbImage\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"color\\"): + this->color = convertRawPropValuecolor)>(propsParserContext, rawValue, \\"color\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"thumbTintColor\\"): + this->thumbTintColor = convertRawPropValuethumbTintColor)>(propsParserContext, rawValue, \\"thumbTintColor\\", {}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"point\\"): + this->point = convertRawPropValuepoint)>(propsParserContext, rawValue, \\"point\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName ImageColorPropNativeComponentProps::getDiffPropsImplementationTarget() const { @@ -2193,6 +2940,16 @@ NoPropsNoEventsComponentProps::NoPropsNoEventsComponentProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void NoPropsNoEventsComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName NoPropsNoEventsComponentProps::getDiffPropsImplementationTarget() const { @@ -2243,6 +3000,22 @@ ObjectPropsProps::ObjectPropsProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), objectProp(convertRawProp(context, rawProps, \\"objectProp\\", sourceProps.objectProp, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void ObjectPropsProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"objectProp\\"): + this->objectProp = convertRawPropValueobjectProp)>(propsParserContext, rawValue, \\"objectProp\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName ObjectPropsProps::getDiffPropsImplementationTarget() const { @@ -2296,6 +3069,22 @@ ObjectPropsWithOptionalGenProps::ObjectPropsWithOptionalGenProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), objectProp(convertRawProp(context, rawProps, \\"objectProp\\", sourceProps.objectProp, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void ObjectPropsWithOptionalGenProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"objectProp\\"): + this->objectProp = convertRawPropValueobjectProp)>(propsParserContext, rawValue, \\"objectProp\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName ObjectPropsWithOptionalGenProps::getDiffPropsImplementationTarget() const { @@ -2353,6 +3142,22 @@ ObjectPropsWithOptionalObjectGenProps::ObjectPropsWithOptionalObjectGenProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), objectProp(convertRawProp(context, rawProps, \\"objectProp\\", sourceProps.objectProp, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void ObjectPropsWithOptionalObjectGenProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"objectProp\\"): + this->objectProp = convertRawPropValueobjectProp)>(propsParserContext, rawValue, \\"objectProp\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName ObjectPropsWithOptionalObjectGenProps::getDiffPropsImplementationTarget() const { @@ -2409,6 +3214,22 @@ PointPropNativeComponentProps::PointPropNativeComponentProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), startPoint(convertRawProp(context, rawProps, \\"startPoint\\", sourceProps.startPoint, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void PointPropNativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"startPoint\\"): + this->startPoint = convertRawPropValuestartPoint)>(propsParserContext, rawValue, \\"startPoint\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName PointPropNativeComponentProps::getDiffPropsImplementationTarget() const { @@ -2461,6 +3282,22 @@ StringEnumPropsNativeComponentProps::StringEnumPropsNativeComponentProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), alignment(convertRawProp(context, rawProps, \\"alignment\\", sourceProps.alignment, {StringEnumPropsNativeComponentAlignment::Center})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void StringEnumPropsNativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"alignment\\"): + this->alignment = convertRawPropValuealignment)>(propsParserContext, rawValue, \\"alignment\\", {StringEnumPropsNativeComponentAlignment::Center}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName StringEnumPropsNativeComponentProps::getDiffPropsImplementationTarget() const { @@ -2514,6 +3351,25 @@ StringPropComponentProps::StringPropComponentProps( accessibilityHint(convertRawProp(context, rawProps, \\"accessibilityHint\\", sourceProps.accessibilityHint, {std::string{\\"\\"}})), accessibilityRole(convertRawProp(context, rawProps, \\"accessibilityRole\\", sourceProps.accessibilityRole, {})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void StringPropComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"accessibilityHint\\"): + this->accessibilityHint = convertRawPropValueaccessibilityHint)>(propsParserContext, rawValue, \\"accessibilityHint\\", {std::string{\\"\\"}}); + return; + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"accessibilityRole\\"): + this->accessibilityRole = convertRawPropValueaccessibilityRole)>(propsParserContext, rawValue, \\"accessibilityRole\\", {}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName StringPropComponentProps::getDiffPropsImplementationTarget() const { @@ -2570,6 +3426,22 @@ MultiFile1NativeComponentProps::MultiFile1NativeComponentProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), disabled(convertRawProp(context, rawProps, \\"disabled\\", sourceProps.disabled, {false})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void MultiFile1NativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"disabled\\"): + this->disabled = convertRawPropValuedisabled)>(propsParserContext, rawValue, \\"disabled\\", {false}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName MultiFile1NativeComponentProps::getDiffPropsImplementationTarget() const { @@ -2599,6 +3471,22 @@ MultiFile2NativeComponentProps::MultiFile2NativeComponentProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), disabled(convertRawProp(context, rawProps, \\"disabled\\", sourceProps.disabled, {true})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void MultiFile2NativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"disabled\\"): + this->disabled = convertRawPropValuedisabled)>(propsParserContext, rawValue, \\"disabled\\", {true}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName MultiFile2NativeComponentProps::getDiffPropsImplementationTarget() const { @@ -2651,6 +3539,22 @@ MultiComponent1NativeComponentProps::MultiComponent1NativeComponentProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), disabled(convertRawProp(context, rawProps, \\"disabled\\", sourceProps.disabled, {false})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void MultiComponent1NativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"disabled\\"): + this->disabled = convertRawPropValuedisabled)>(propsParserContext, rawValue, \\"disabled\\", {false}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName MultiComponent1NativeComponentProps::getDiffPropsImplementationTarget() const { @@ -2680,6 +3584,22 @@ MultiComponent2NativeComponentProps::MultiComponent2NativeComponentProps( const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), disabled(convertRawProp(context, rawProps, \\"disabled\\", sourceProps.disabled, {true})) {} + +#ifdef RN_HAS_CONVERT_RAW_PROP_VALUE +void MultiComponent2NativeComponentProps::setProp( + const PropsParserContext &propsParserContext, + RawPropsPropNameHash propNameHash, + const char *rawPropName, + const RawValue &rawValue) { + ViewProps::setProp(propsParserContext, propNameHash, rawPropName, rawValue); + + switch (propNameHash) { + case CONSTEXPR_RAW_PROPS_KEY_HASH(\\"disabled\\"): + this->disabled = convertRawPropValuedisabled)>(propsParserContext, rawValue, \\"disabled\\", {true}); + return; + } +} +#endif #ifdef RN_SERIALIZABLE_STATE ComponentName MultiComponent2NativeComponentProps::getDiffPropsImplementationTarget() const { diff --git a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsH-test.js.snap b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsH-test.js.snap index 8e6f554fb545..b2673c4698e5 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsH-test.js.snap +++ b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsH-test.js.snap @@ -340,6 +340,10 @@ class AllPropProps final : public ViewProps { AllPropProps() = default; AllPropProps(const PropsParserContext& context, const AllPropProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props std::string stringPropNoDefault{}; @@ -714,6 +718,10 @@ class AllPropWithOptionalGenProps final : public ViewProps { AllPropWithOptionalGenProps() = default; AllPropWithOptionalGenProps(const PropsParserContext& context, const AllPropWithOptionalGenProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props std::optional stringPropNoDefault{}; @@ -1102,6 +1110,10 @@ class AllPropWithOptionalObjectGenProps final : public ViewProps { AllPropWithOptionalObjectGenProps() = default; AllPropWithOptionalObjectGenProps(const PropsParserContext& context, const AllPropWithOptionalObjectGenProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props std::optional stringPropNoDefault{}; @@ -1162,7 +1174,7 @@ namespace facebook::react { using ArrayPropsNativeComponentSizesMask = uint32_t; struct ArrayPropsNativeComponentSizesMaskWrapped { - ArrayPropsNativeComponentSizesMask value; + ArrayPropsNativeComponentSizesMask value{}; }; enum class ArrayPropsNativeComponentSizes: ArrayPropsNativeComponentSizesMask { @@ -1402,6 +1414,10 @@ class ArrayPropsNativeComponentProps final : public ViewProps { ArrayPropsNativeComponentProps() = default; ArrayPropsNativeComponentProps(const PropsParserContext& context, const ArrayPropsNativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props std::vector names{}; @@ -1514,6 +1530,10 @@ class ArrayPropsNativeComponentProps final : public ViewProps { ArrayPropsNativeComponentProps() = default; ArrayPropsNativeComponentProps(const PropsParserContext& context, const ArrayPropsNativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props std::vector nativePrimitives{}; @@ -1614,6 +1634,10 @@ class ArrayPropsOptionalGenNativeComponentProps final : public ViewProps { ArrayPropsOptionalGenNativeComponentProps() = default; ArrayPropsOptionalGenNativeComponentProps(const PropsParserContext& context, const ArrayPropsOptionalGenNativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props std::optional> nativePrimitives{}; @@ -1720,6 +1744,10 @@ class ArrayPropsOptionalObjectGenNativeComponentProps final : public ViewProps { ArrayPropsOptionalObjectGenNativeComponentProps() = default; ArrayPropsOptionalObjectGenNativeComponentProps(const PropsParserContext& context, const ArrayPropsOptionalObjectGenNativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props std::optional> nativePrimitives{}; @@ -1764,7 +1792,7 @@ namespace facebook::react { using ArrayPropsWithOptionalGenNativeComponentSizesMask = uint32_t; struct ArrayPropsWithOptionalGenNativeComponentSizesMaskWrapped { - ArrayPropsWithOptionalGenNativeComponentSizesMask value; + ArrayPropsWithOptionalGenNativeComponentSizesMask value{}; }; enum class ArrayPropsWithOptionalGenNativeComponentSizes: ArrayPropsWithOptionalGenNativeComponentSizesMask { @@ -2004,6 +2032,10 @@ class ArrayPropsWithOptionalGenNativeComponentProps final : public ViewProps { ArrayPropsWithOptionalGenNativeComponentProps() = default; ArrayPropsWithOptionalGenNativeComponentProps(const PropsParserContext& context, const ArrayPropsWithOptionalGenNativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props std::optional> names{}; @@ -2060,7 +2092,7 @@ namespace facebook::react { using ArrayPropsWithOptionalObjectGenNativeComponentSizesMask = uint32_t; struct ArrayPropsWithOptionalObjectGenNativeComponentSizesMaskWrapped { - ArrayPropsWithOptionalObjectGenNativeComponentSizesMask value; + ArrayPropsWithOptionalObjectGenNativeComponentSizesMask value{}; }; enum class ArrayPropsWithOptionalObjectGenNativeComponentSizes: ArrayPropsWithOptionalObjectGenNativeComponentSizesMask { @@ -2302,6 +2334,10 @@ class ArrayPropsWithOptionalObjectGenNativeComponentProps final : public ViewPro ArrayPropsWithOptionalObjectGenNativeComponentProps() = default; ArrayPropsWithOptionalObjectGenNativeComponentProps(const PropsParserContext& context, const ArrayPropsWithOptionalObjectGenNativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props std::optional> names{}; @@ -2355,6 +2391,10 @@ class BooleanPropNativeComponentProps final : public ViewProps { BooleanPropNativeComponentProps() = default; BooleanPropNativeComponentProps(const PropsParserContext& context, const BooleanPropNativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props bool disabled{false}; @@ -2397,6 +2437,10 @@ class ColorPropNativeComponentProps final : public ViewProps { ColorPropNativeComponentProps() = default; ColorPropNativeComponentProps(const PropsParserContext& context, const ColorPropNativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props SharedColor tintColor{}; @@ -2438,6 +2482,10 @@ class CommandNativeComponentProps final : public ViewProps { CommandNativeComponentProps() = default; CommandNativeComponentProps(const PropsParserContext& context, const CommandNativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props @@ -2479,6 +2527,10 @@ class CommandNativeComponentProps final : public ViewProps { CommandNativeComponentProps() = default; CommandNativeComponentProps(const PropsParserContext& context, const CommandNativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props std::string accessibilityHint{std::string{\\"\\"}}; @@ -2521,6 +2573,10 @@ class DimensionPropNativeComponentProps final : public ViewProps { DimensionPropNativeComponentProps() = default; DimensionPropNativeComponentProps(const PropsParserContext& context, const DimensionPropNativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props YGValue marginBack{}; @@ -2562,6 +2618,10 @@ class DoublePropNativeComponentProps final : public ViewProps { DoublePropNativeComponentProps() = default; DoublePropNativeComponentProps(const PropsParserContext& context, const DoublePropNativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props double blurRadius{0.0}; @@ -2608,6 +2668,10 @@ class EventsNestedObjectNativeComponentProps final : public ViewProps { EventsNestedObjectNativeComponentProps() = default; EventsNestedObjectNativeComponentProps(const PropsParserContext& context, const EventsNestedObjectNativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props bool disabled{false}; @@ -2649,6 +2713,10 @@ class EventsNativeComponentProps final : public ViewProps { EventsNativeComponentProps() = default; EventsNativeComponentProps(const PropsParserContext& context, const EventsNativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props bool disabled{false}; @@ -2690,6 +2758,10 @@ class InterfaceOnlyComponentProps final : public ViewProps { InterfaceOnlyComponentProps() = default; InterfaceOnlyComponentProps(const PropsParserContext& context, const InterfaceOnlyComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props @@ -2731,6 +2803,10 @@ class ExcludedAndroidComponentProps final : public ViewProps { ExcludedAndroidComponentProps() = default; ExcludedAndroidComponentProps(const PropsParserContext& context, const ExcludedAndroidComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props @@ -2772,6 +2848,10 @@ class ExcludedAndroidIosComponentProps final : public ViewProps { ExcludedAndroidIosComponentProps() = default; ExcludedAndroidIosComponentProps(const PropsParserContext& context, const ExcludedAndroidIosComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props @@ -2813,6 +2893,10 @@ class ExcludedIosComponentProps final : public ViewProps { ExcludedIosComponentProps() = default; ExcludedIosComponentProps(const PropsParserContext& context, const ExcludedIosComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props @@ -2831,6 +2915,10 @@ class MultiFileIncludedNativeComponentProps final : public ViewProps { MultiFileIncludedNativeComponentProps() = default; MultiFileIncludedNativeComponentProps(const PropsParserContext& context, const MultiFileIncludedNativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props bool disabled{true}; @@ -2872,6 +2960,10 @@ class FloatPropNativeComponentProps final : public ViewProps { FloatPropNativeComponentProps() = default; FloatPropNativeComponentProps(const PropsParserContext& context, const FloatPropNativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props Float blurRadius{0.0}; @@ -2919,6 +3011,10 @@ class ImagePropNativeComponentProps final : public ViewProps { ImagePropNativeComponentProps() = default; ImagePropNativeComponentProps(const PropsParserContext& context, const ImagePropNativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props ImageSource thumbImage{}; @@ -2961,6 +3057,10 @@ class InsetsPropNativeComponentProps final : public ViewProps { InsetsPropNativeComponentProps() = default; InsetsPropNativeComponentProps(const PropsParserContext& context, const InsetsPropNativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props EdgeInsets contentInset{}; @@ -3044,6 +3144,10 @@ class Int32EnumPropsNativeComponentProps final : public ViewProps { Int32EnumPropsNativeComponentProps() = default; Int32EnumPropsNativeComponentProps(const PropsParserContext& context, const Int32EnumPropsNativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props Int32EnumPropsNativeComponentMaxInterval maxInterval{Int32EnumPropsNativeComponentMaxInterval::MaxInterval0}; @@ -3085,6 +3189,10 @@ class IntegerPropNativeComponentProps final : public ViewProps { IntegerPropNativeComponentProps() = default; IntegerPropNativeComponentProps(const PropsParserContext& context, const IntegerPropNativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props int progress1{0}; @@ -3128,6 +3236,10 @@ class InterfaceOnlyComponentProps final : public ViewProps { InterfaceOnlyComponentProps() = default; InterfaceOnlyComponentProps(const PropsParserContext& context, const InterfaceOnlyComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props std::string accessibilityHint{std::string{\\"\\"}}; @@ -3169,6 +3281,10 @@ class MixedPropNativeComponentProps final : public ViewProps { MixedPropNativeComponentProps() = default; MixedPropNativeComponentProps(const PropsParserContext& context, const MixedPropNativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props folly::dynamic mixedProp{}; @@ -3212,6 +3328,10 @@ class ImageColorPropNativeComponentProps final : public ViewProps { ImageColorPropNativeComponentProps() = default; ImageColorPropNativeComponentProps(const PropsParserContext& context, const ImageColorPropNativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props ImageSource thumbImage{}; @@ -3256,6 +3376,10 @@ class NoPropsNoEventsComponentProps final : public ViewProps { NoPropsNoEventsComponentProps() = default; NoPropsNoEventsComponentProps(const PropsParserContext& context, const NoPropsNoEventsComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props @@ -3690,6 +3814,10 @@ class ObjectPropsProps final : public ViewProps { ObjectPropsProps() = default; ObjectPropsProps(const PropsParserContext& context, const ObjectPropsProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props ObjectPropsObjectPropStruct objectProp{}; @@ -4124,6 +4252,10 @@ class ObjectPropsWithOptionalGenProps final : public ViewProps { ObjectPropsWithOptionalGenProps() = default; ObjectPropsWithOptionalGenProps(const PropsParserContext& context, const ObjectPropsWithOptionalGenProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props std::optional objectProp{}; @@ -4566,6 +4698,10 @@ class ObjectPropsWithOptionalObjectGenProps final : public ViewProps { ObjectPropsWithOptionalObjectGenProps() = default; ObjectPropsWithOptionalObjectGenProps(const PropsParserContext& context, const ObjectPropsWithOptionalObjectGenProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props std::optional objectProp{}; @@ -4608,6 +4744,10 @@ class PointPropNativeComponentProps final : public ViewProps { PointPropNativeComponentProps() = default; PointPropNativeComponentProps(const PropsParserContext& context, const PointPropNativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props Point startPoint{}; @@ -4675,6 +4815,10 @@ class StringEnumPropsNativeComponentProps final : public ViewProps { StringEnumPropsNativeComponentProps() = default; StringEnumPropsNativeComponentProps(const PropsParserContext& context, const StringEnumPropsNativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props StringEnumPropsNativeComponentAlignment alignment{StringEnumPropsNativeComponentAlignment::Center}; @@ -4716,6 +4860,10 @@ class StringPropComponentProps final : public ViewProps { StringPropComponentProps() = default; StringPropComponentProps(const PropsParserContext& context, const StringPropComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props std::string accessibilityHint{std::string{\\"\\"}}; @@ -4758,6 +4906,10 @@ class MultiFile1NativeComponentProps final : public ViewProps { MultiFile1NativeComponentProps() = default; MultiFile1NativeComponentProps(const PropsParserContext& context, const MultiFile1NativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props bool disabled{false}; @@ -4776,6 +4928,10 @@ class MultiFile2NativeComponentProps final : public ViewProps { MultiFile2NativeComponentProps() = default; MultiFile2NativeComponentProps(const PropsParserContext& context, const MultiFile2NativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props bool disabled{true}; @@ -4817,6 +4973,10 @@ class MultiComponent1NativeComponentProps final : public ViewProps { MultiComponent1NativeComponentProps() = default; MultiComponent1NativeComponentProps(const PropsParserContext& context, const MultiComponent1NativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props bool disabled{false}; @@ -4835,6 +4995,10 @@ class MultiComponent2NativeComponentProps final : public ViewProps { MultiComponent2NativeComponentProps() = default; MultiComponent2NativeComponentProps(const PropsParserContext& context, const MultiComponent2NativeComponentProps &sourceProps, const RawProps &rawProps); + #ifdef RN_HAS_CONVERT_RAW_PROP_VALUE + void setProp(const PropsParserContext& propsParserContext, RawPropsPropNameHash propNameHash, const char *rawPropName, const RawValue &rawValue); + #endif + #pragma mark - Props bool disabled{true}; diff --git a/packages/react-native/Libraries/Modal/__tests__/Modal-itest.js b/packages/react-native/Libraries/Modal/__tests__/Modal-itest.js index 34e268d2442a..46c8583fd80f 100644 --- a/packages/react-native/Libraries/Modal/__tests__/Modal-itest.js +++ b/packages/react-native/Libraries/Modal/__tests__/Modal-itest.js @@ -6,6 +6,7 @@ * * @flow strict-local * @format + * @fantom_flags enableCppPropsIteratorSetter:* */ import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment'; diff --git a/packages/react-native/ReactCommon/react/renderer/components/modal/tests/GeneratedPropsSetPropTest.cpp b/packages/react-native/ReactCommon/react/renderer/components/modal/tests/GeneratedPropsSetPropTest.cpp new file mode 100644 index 000000000000..21ab46fc3fa0 --- /dev/null +++ b/packages/react-native/ReactCommon/react/renderer/components/modal/tests/GeneratedPropsSetPropTest.cpp @@ -0,0 +1,241 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +using namespace facebook::react; + +// Props generated by codegen declare their own `setProp`, so components built +// on them take the iterator-setter path when `enableCppPropsIteratorSetter` is +// on instead of always using the classic constructor. +static_assert(HasIteratorSetterCtor); +static_assert(HasIteratorSetterCtor); +static_assert(HasIteratorSetterCtor); +static_assert(HasIteratorSetterCtor); + +namespace { + +template +struct BuiltProps { + std::shared_ptr constructed; + std::shared_ptr set; +}; + +// Applies each update in order, the way React updates a node, building the +// props both with the generated constructor and with the generated `setProp` +// on a copy of the previous props. Returns both after every update. +template +std::vector> buildBothWays( + const std::vector& updates) { + ContextContainer contextContainer{}; + PropsParserContext context{-1, contextContainer}; + RawPropsParser parser{}; + parser.prepare(); + + std::vector> results; + auto constructed = std::make_shared(); + auto set = std::make_shared(); + for (const auto& update : updates) { + auto parsedRawProps = RawProps(update); + parsedRawProps.parse(parser); + constructed = + std::make_shared(context, *constructed, parsedRawProps); + + auto nextSet = std::make_shared(*set); + RawProps(update).forEachItem([&](std::string_view name, + const RawValue& value) { + nextSet->setProp(context, RAW_PROPS_KEY_HASH(name), name.data(), value); + }); + set = nextSet; + + results.push_back({.constructed = constructed, .set = set}); + } + return results; +} + +class IteratorSetterFlags : public ReactNativeFeatureFlagsDefaults { + public: + explicit IteratorSetterFlags(bool enabled) : enabled_(enabled) {} + + bool enableCppPropsIteratorSetter() override { + return enabled_; + } + + private: + bool enabled_; +}; + +// Applies each update through the component descriptor's `cloneProps` with +// `enableCppPropsIteratorSetter` set to `iteratorSetter`. +template +std::vector> +cloneWithFlag(bool iteratorSetter, const std::vector& updates) { + ReactNativeFeatureFlags::dangerouslyReset(); + ReactNativeFeatureFlags::override( + std::make_unique(iteratorSetter)); + + // The descriptor prepares its props parser for the classic path only when + // the flag is off, so it is created after the flag is set. + auto descriptor = std::make_shared(ComponentDescriptorParameters{ + .eventDispatcher = std::shared_ptr(), + .contextContainer = nullptr, + .flavor = nullptr}); + ContextContainer contextContainer{}; + PropsParserContext context{-1, contextContainer}; + + std::vector> + results; + Props::Shared props = nullptr; + for (const auto& update : updates) { + props = descriptor->cloneProps(context, props, RawProps(update)); + results.push_back( + std::static_pointer_cast( + props)); + } + + ReactNativeFeatureFlags::dangerouslyReset(); + return results; +} + +constexpr auto mask(ModalHostViewSupportedOrientations orientation) { + return static_cast(orientation); +} + +} // namespace + +TEST(GeneratedPropsSetPropTest, enumMaskIsReplacedNotMerged) { + auto results = buildBothWays({ + folly::dynamic::object( + "supportedOrientations", + folly::dynamic::array("landscape", "portrait"))( + "animationType", "slide")("visible", true)("identifier", 7), + folly::dynamic::object( + "supportedOrientations", folly::dynamic::array("landscape")), + folly::dynamic::object("supportedOrientations", nullptr)( + "animationType", nullptr)("visible", nullptr), + folly::dynamic::object( + "supportedOrientations", + folly::dynamic::array("portrait-upside-down")), + }); + + for (size_t i = 0; i < results.size(); i++) { + SCOPED_TRACE(i); + const auto& [constructed, set] = results[i]; + EXPECT_EQ(set->supportedOrientations, constructed->supportedOrientations); + EXPECT_EQ(set->animationType, constructed->animationType); + EXPECT_EQ(set->visible, constructed->visible); + EXPECT_EQ(set->identifier, constructed->identifier); + } + + EXPECT_EQ( + results[0].set->supportedOrientations, + mask(ModalHostViewSupportedOrientations::Landscape) | + mask(ModalHostViewSupportedOrientations::Portrait)); + EXPECT_EQ( + results[1].set->supportedOrientations, + mask(ModalHostViewSupportedOrientations::Landscape)); + EXPECT_EQ(results[1].set->identifier, 7); + // `null` restores the schema default. + EXPECT_EQ( + results[2].set->supportedOrientations, + mask(ModalHostViewSupportedOrientations::Portrait)); + EXPECT_EQ(results[2].set->animationType, ModalHostViewAnimationType::None); + EXPECT_EQ(results[2].set->visible, false); + EXPECT_EQ( + results[3].set->supportedOrientations, + mask(ModalHostViewSupportedOrientations::PortraitUpsideDown)); +} + +TEST(GeneratedPropsSetPropTest, arrayIsReplacedNotAppended) { + auto results = buildBothWays({ + folly::dynamic::object( + "colors", folly::dynamic::array(0xffff0000, 0xff00ff00))( + "enabled", false)("progressViewOffset", 12.5)("size", "large"), + folly::dynamic::object("colors", folly::dynamic::array(0xff0000ff)), + folly::dynamic::object("colors", nullptr)("enabled", nullptr)( + "size", nullptr), + }); + + for (size_t i = 0; i < results.size(); i++) { + SCOPED_TRACE(i); + const auto& [constructed, set] = results[i]; + EXPECT_EQ(set->colors, constructed->colors); + EXPECT_EQ(set->enabled, constructed->enabled); + EXPECT_EQ(set->progressViewOffset, constructed->progressViewOffset); + EXPECT_EQ(set->size, constructed->size); + } + + EXPECT_EQ(results[0].set->colors.size(), 2); + EXPECT_EQ(results[1].set->colors.size(), 1); + EXPECT_EQ(results[1].set->progressViewOffset, 12.5); + EXPECT_TRUE(results[2].set->colors.empty()); + // The schema default, which differs from a value-initialized `bool`. + EXPECT_EQ(results[2].set->enabled, true); + EXPECT_EQ(results[2].set->size, AndroidSwipeRefreshLayoutSize::Default); +} + +TEST(GeneratedPropsSetPropTest, cloneMatchesWithTheIteratorSetterOnAndOff) { + const auto activityIndicatorUpdates = std::vector{ + folly::dynamic::object("hidesWhenStopped", false)("animating", false)( + "size", "large")("color", 0xff0000ff)("nativeID", "a"), + folly::dynamic::object("size", "small"), + folly::dynamic::object("hidesWhenStopped", nullptr)("size", nullptr)( + "color", nullptr)("nativeID", nullptr), + }; + auto classic = cloneWithFlag( + false, activityIndicatorUpdates); + auto iterator = cloneWithFlag( + true, activityIndicatorUpdates); + ASSERT_EQ(classic.size(), iterator.size()); + for (size_t i = 0; i < classic.size(); i++) { + SCOPED_TRACE(i); + EXPECT_EQ(iterator[i]->hidesWhenStopped, classic[i]->hidesWhenStopped); + EXPECT_EQ(iterator[i]->animating, classic[i]->animating); + EXPECT_EQ(iterator[i]->size, classic[i]->size); + EXPECT_EQ(iterator[i]->color, classic[i]->color); + EXPECT_EQ(iterator[i]->nativeId, classic[i]->nativeId); + } + EXPECT_EQ(iterator[2]->hidesWhenStopped, true); + + const auto swipeRefreshUpdates = std::vector{ + folly::dynamic::object( + "colors", folly::dynamic::array(0xffff0000, 0xff00ff00))( + "enabled", false)("opacity", 0.5), + folly::dynamic::object("colors", folly::dynamic::array(0xff0000ff)), + folly::dynamic::object("colors", nullptr)("enabled", nullptr), + }; + auto classicSwipeRefresh = + cloneWithFlag( + false, swipeRefreshUpdates); + auto iteratorSwipeRefresh = + cloneWithFlag( + true, swipeRefreshUpdates); + ASSERT_EQ(classicSwipeRefresh.size(), iteratorSwipeRefresh.size()); + for (size_t i = 0; i < classicSwipeRefresh.size(); i++) { + SCOPED_TRACE(i); + EXPECT_EQ(iteratorSwipeRefresh[i]->colors, classicSwipeRefresh[i]->colors); + EXPECT_EQ( + iteratorSwipeRefresh[i]->enabled, classicSwipeRefresh[i]->enabled); + EXPECT_EQ( + iteratorSwipeRefresh[i]->opacity, classicSwipeRefresh[i]->opacity); + } + EXPECT_EQ(iteratorSwipeRefresh[1]->colors.size(), 1); + EXPECT_EQ(iteratorSwipeRefresh[2]->enabled, true); +} diff --git a/packages/react-native/ReactCommon/react/renderer/core/propsConversions.h b/packages/react-native/ReactCommon/react/renderer/core/propsConversions.h index 0e7ed7608641..1c5e28cd4c80 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/propsConversions.h +++ b/packages/react-native/ReactCommon/react/renderer/core/propsConversions.h @@ -168,28 +168,34 @@ void fromRawValue(const PropsParserContext &context, const RawValue &rawValue, s result.push_back(itemResult); } +// Lets generated code check for `convertRawPropValue`: code generated by a +// newer codegen can be compiled against a React Native without it. +#define RN_HAS_CONVERT_RAW_PROP_VALUE 1 + +/* + * Converts the value of a prop that is present in the raw props, as + * `convertRawProp` does: `null` gives `defaultValue`, a value is converted into + * a new `T` instead of being merged into an existing one, and a value that + * fails to convert gives `defaultValue`. Generated `setProp` implementations + * call it so that the iterator-setter path builds the same props as the + * constructors. + */ template -T convertRawProp( +T convertRawPropValue( const PropsParserContext &context, - const RawProps &rawProps, + const RawValue &rawValue, const char *name, - const T &sourceValue, const U &defaultValue) { - const auto *rawValue = rawProps.at(name); - if (rawValue == nullptr) [[likely]] { - return sourceValue; - } - // Special case: `null` always means "the prop was removed, use default // value". - if (!rawValue->hasValue()) [[unlikely]] { + if (!rawValue.hasValue()) [[unlikely]] { return defaultValue; } try { T result; - fromRawValue(context, *rawValue, result); + fromRawValue(context, rawValue, result); return result; } catch (const std::exception &e) { // In case of errors, log the error and fall back to the default @@ -199,4 +205,19 @@ T convertRawProp( } } +template +T convertRawProp( + const PropsParserContext &context, + const RawProps &rawProps, + const char *name, + const T &sourceValue, + const U &defaultValue) +{ + const auto *rawValue = rawProps.at(name); + if (rawValue == nullptr) [[likely]] { + return sourceValue; + } + return convertRawPropValue(context, *rawValue, name, defaultValue); +} + } // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/core/tests/PropsConceptsTest.cpp b/packages/react-native/ReactCommon/react/renderer/core/tests/PropsConceptsTest.cpp index 656bd0612448..36c10260da34 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/tests/PropsConceptsTest.cpp +++ b/packages/react-native/ReactCommon/react/renderer/core/tests/PropsConceptsTest.cpp @@ -15,18 +15,15 @@ using namespace facebook::react; namespace { -// Mimics the shape the React Native codegen emits for -// `codegenNativeComponent(...)` (see -// `react-native-codegen/src/generators/components/GeneratePropsH.js` -// `ClassTemplate`): default ctor, the 3-arg classic ctor with -// `convertRawProp` in its initializer list, public prop fields, and -// NO `setProp` override. -class CodegenStyleProps : public Props { +// Props built only by the 3-arg classic ctor, with `convertRawProp` in its +// initializer list and NO `setProp` override: hand-written Props that never +// opted in, or code from a codegen that predates generated `setProp`. +class ConstructorOnlyProps : public Props { public: - CodegenStyleProps() = default; - CodegenStyleProps( + ConstructorOnlyProps() = default; + ConstructorOnlyProps( const PropsParserContext& context, - const CodegenStyleProps& sourceProps, + const ConstructorOnlyProps& sourceProps, const RawProps& rawProps) : Props(context, sourceProps, rawProps), customField(convertRawProp( @@ -95,15 +92,15 @@ class UsingDeclSetPropProps : public HandWrittenSetPropProps { // Concept axioms — fail the build if the iterator-setter dispatch ever // regresses to silently accepting classes that inherit `setProp`. static_assert( - !DeclaresOwnSetProp, - "Codegen'd Props classes don't declare setProp — concept must reject them."); + !DeclaresOwnSetProp, + "Props without their own setProp must be rejected by the concept."); static_assert( - !HasSetProp, + !HasSetProp, "HasSetProp requires DeclaresOwnSetProp."); static_assert( - !HasIteratorSetterCtor, - "Codegen'd Props must fall through to the classic cloneProps path. " - "If this fires, the iterator-setter would skip every field the codegen'd " + !HasIteratorSetterCtor, + "Props without their own setProp must fall through to the classic cloneProps path. " + "If this fires, the iterator-setter would skip every field the classic " "ctor populates via convertRawProp, leaving the component unrendered."); static_assert(DeclaresOwnSetProp); diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api index ece6b944c73a..4e973954b544 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api @@ -580,6 +580,8 @@ template T facebook::react::convertRawProp(const facebook::react::PropsParserContext& context, const facebook::react::RawProps& rawProps, const char* name, const T& sourceValue, const U& defaultValue); +template +T facebook::react::convertRawPropValue(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& rawValue, const char* name, const U& defaultValue); template folly::dynamic facebook::react::toDynamic(const std::vector& arrayValue); template diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api index 96f1de574a16..8c18bca644f8 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api @@ -851,6 +851,8 @@ template T facebook::react::convertRawProp(const facebook::react::PropsParserContext& context, const facebook::react::RawProps& rawProps, const char* name, const T& sourceValue, const U& defaultValue); +template +T facebook::react::convertRawPropValue(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& rawValue, const char* name, const U& defaultValue); template T facebook::react::get(const facebook::react::AnimatedPropBase& animatedProp); template diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api index 809dada6ec58..412d1daa4697 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api @@ -580,6 +580,8 @@ template T facebook::react::convertRawProp(const facebook::react::PropsParserContext& context, const facebook::react::RawProps& rawProps, const char* name, const T& sourceValue, const U& defaultValue); +template +T facebook::react::convertRawPropValue(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& rawValue, const char* name, const U& defaultValue); template folly::dynamic facebook::react::toDynamic(const std::vector& arrayValue); template diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api index 809dada6ec58..412d1daa4697 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api @@ -580,6 +580,8 @@ template T facebook::react::convertRawProp(const facebook::react::PropsParserContext& context, const facebook::react::RawProps& rawProps, const char* name, const T& sourceValue, const U& defaultValue); +template +T facebook::react::convertRawPropValue(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& rawValue, const char* name, const U& defaultValue); template folly::dynamic facebook::react::toDynamic(const std::vector& arrayValue); template diff --git a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api index 00b196227198..67f0ba349f6b 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api @@ -3297,6 +3297,8 @@ template RCTManagedPointer* facebook::react::managedPointer(P initializer); template T facebook::react::convertRawProp(const facebook::react::PropsParserContext& context, const facebook::react::RawProps& rawProps, const char* name, const T& sourceValue, const U& defaultValue); +template +T facebook::react::convertRawPropValue(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& rawValue, const char* name, const U& defaultValue); template facebook::react::ModuleConstants facebook::react::typedConstants(typename T::Builder::Input&& value); template diff --git a/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api index fc711f07ba9a..994bc34bfdb5 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api @@ -3605,6 +3605,8 @@ template RCTManagedPointer* facebook::react::managedPointer(P initializer); template T facebook::react::convertRawProp(const facebook::react::PropsParserContext& context, const facebook::react::RawProps& rawProps, const char* name, const T& sourceValue, const U& defaultValue); +template +T facebook::react::convertRawPropValue(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& rawValue, const char* name, const U& defaultValue); template T facebook::react::get(const facebook::react::AnimatedPropBase& animatedProp); template diff --git a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api index a6260dedf98d..693aac07e453 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api @@ -3290,6 +3290,8 @@ template RCTManagedPointer* facebook::react::managedPointer(P initializer); template T facebook::react::convertRawProp(const facebook::react::PropsParserContext& context, const facebook::react::RawProps& rawProps, const char* name, const T& sourceValue, const U& defaultValue); +template +T facebook::react::convertRawPropValue(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& rawValue, const char* name, const U& defaultValue); template facebook::react::ModuleConstants facebook::react::typedConstants(typename T::Builder::Input&& value); template diff --git a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api index b7f61c537afd..0cb5b0ac7e08 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api @@ -3297,6 +3297,8 @@ template RCTManagedPointer* facebook::react::managedPointer(P initializer); template T facebook::react::convertRawProp(const facebook::react::PropsParserContext& context, const facebook::react::RawProps& rawProps, const char* name, const T& sourceValue, const U& defaultValue); +template +T facebook::react::convertRawPropValue(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& rawValue, const char* name, const U& defaultValue); template facebook::react::ModuleConstants facebook::react::typedConstants(typename T::Builder::Input&& value); template diff --git a/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api index bfc0cd340bc9..fe94f7590c18 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api @@ -217,6 +217,8 @@ template T facebook::react::convertRawProp(const facebook::react::PropsParserContext& context, const facebook::react::RawProps& rawProps, const char* name, const T& sourceValue, const U& defaultValue); +template +T facebook::react::convertRawPropValue(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& rawValue, const char* name, const U& defaultValue); template void facebook::react::fromRawValue(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& rawValue, T& result, T defaultValue); template diff --git a/scripts/cxx-api/api-snapshots/ReactCommonFrameworksCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonFrameworksCxx.api index 66dccbe50765..7452e397b55c 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonFrameworksCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonFrameworksCxx.api @@ -421,6 +421,8 @@ template T facebook::react::convertRawProp(const facebook::react::PropsParserContext& context, const facebook::react::RawProps& rawProps, const char* name, const T& sourceValue, const U& defaultValue); +template +T facebook::react::convertRawPropValue(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& rawValue, const char* name, const U& defaultValue); template T facebook::react::get(const facebook::react::AnimatedPropBase& animatedProp); template diff --git a/scripts/cxx-api/api-snapshots/ReactCommonNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonNewarchCxx.api index 230268227245..e2842076b7e1 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonNewarchCxx.api @@ -217,6 +217,8 @@ template T facebook::react::convertRawProp(const facebook::react::PropsParserContext& context, const facebook::react::RawProps& rawProps, const char* name, const T& sourceValue, const U& defaultValue); +template +T facebook::react::convertRawPropValue(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& rawValue, const char* name, const U& defaultValue); template void facebook::react::fromRawValue(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& rawValue, T& result, T defaultValue); template diff --git a/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api index 230268227245..e2842076b7e1 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api @@ -217,6 +217,8 @@ template T facebook::react::convertRawProp(const facebook::react::PropsParserContext& context, const facebook::react::RawProps& rawProps, const char* name, const T& sourceValue, const U& defaultValue); +template +T facebook::react::convertRawPropValue(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& rawValue, const char* name, const U& defaultValue); template void facebook::react::fromRawValue(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& rawValue, T& result, T defaultValue); template