diff --git a/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimatedPropSerializer.cpp b/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimatedPropSerializer.cpp index 7018279f83b5..2210b6fd93d9 100644 --- a/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimatedPropSerializer.cpp +++ b/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimatedPropSerializer.cpp @@ -462,9 +462,9 @@ void packBoxShadow(folly::dynamic& dyn, const AnimatedPropBase& animatedProp) { void packMixBlendMode( folly::dynamic& dyn, const AnimatedPropBase& animatedProp) { - const auto& blendMode = get(animatedProp); + const auto& mixBlendMode = get(animatedProp); std::string blendModeStr; - switch (blendMode) { + switch (mixBlendMode) { case BlendMode::Normal: blendModeStr = "normal"; break; @@ -519,6 +519,25 @@ void packMixBlendMode( dyn.insert("mixBlendMode", blendModeStr); } +void packBackfaceVisibility( + folly::dynamic& dyn, + const AnimatedPropBase& animatedProp) { + const auto& backfaceVisibility = get(animatedProp); + std::string visibilityStr; + switch (backfaceVisibility) { + case BackfaceVisibility::Auto: + visibilityStr = "auto"; + break; + case BackfaceVisibility::Visible: + visibilityStr = "visible"; + break; + case BackfaceVisibility::Hidden: + visibilityStr = "hidden"; + break; + } + dyn.insert("backfaceVisibility", visibilityStr); +} + void packAnimatedProp( folly::dynamic& dyn, const std::unique_ptr& animatedProp) { @@ -607,6 +626,10 @@ void packAnimatedProp( packMixBlendMode(dyn, *animatedProp); break; + case BACKFACE_VISIBILITY: + packBackfaceVisibility(dyn, *animatedProp); + break; + case WIDTH: case HEIGHT: case FLEX: diff --git a/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimatedProps.h b/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimatedProps.h index 1431a244bfc4..43a76ee1e5f9 100644 --- a/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimatedProps.h +++ b/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimatedProps.h @@ -62,7 +62,8 @@ enum PropName { ISOLATION, CURSOR, BOX_SHADOW, - MIX_BLEND_MODE + MIX_BLEND_MODE, + BACKFACE_VISIBILITY }; struct AnimatedPropBase { @@ -410,6 +411,10 @@ inline void cloneProp(BaseViewProps &viewProps, const AnimatedPropBase &animated viewProps.mixBlendMode = get(animatedProp); break; + case BACKFACE_VISIBILITY: + viewProps.backfaceVisibility = get(animatedProp); + break; + default: break; } diff --git a/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimatedPropsBuilder.h b/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimatedPropsBuilder.h index 8d3822fe5c94..eb884dc1a4f8 100644 --- a/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimatedPropsBuilder.h +++ b/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimatedPropsBuilder.h @@ -52,6 +52,10 @@ struct AnimatedPropsBuilder { { props.push_back(std::make_unique>>(POSITION, value)); } + void setFlex(yoga::FloatOptional value) + { + props.push_back(std::make_unique>(FLEX, value)); + } void setTransform(Transform &t) { props.push_back(std::make_unique>(TRANSFORM, std::move(t))); @@ -212,6 +216,10 @@ struct AnimatedPropsBuilder { { props.push_back(std::make_unique>(MIX_BLEND_MODE, value)); } + void setBackfaceVisibility(BackfaceVisibility value) + { + props.push_back(std::make_unique>(BACKFACE_VISIBILITY, value)); + } void storeDynamic(folly::dynamic &d) { rawProps = std::make_unique(std::move(d)); diff --git a/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimatedPropsRegistry.h b/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimatedPropsRegistry.h index cfb1d83581cc..bac7b738237c 100644 --- a/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimatedPropsRegistry.h +++ b/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimatedPropsRegistry.h @@ -284,6 +284,10 @@ inline void updateProp(const PropName propName, BaseViewProps &viewProps, const case MIX_BLEND_MODE: viewProps.mixBlendMode = snapshot.props.mixBlendMode; break; + + case BACKFACE_VISIBILITY: + viewProps.backfaceVisibility = snapshot.props.backfaceVisibility; + break; } }