From 0a738663cd728847b4163f8e1bb93bcdfc4f1b0c Mon Sep 17 00:00:00 2001 From: Aditya kumar singh <143548997+Adityakk9031@users.noreply.github.com> Date: Mon, 9 Mar 2026 20:37:34 +0530 Subject: [PATCH 1/2] Fixes CSS transform styles applied directly to components are silently ignored on iOS when using the new architecture --- .../renderer/components/text/TextProps.cpp | 22 ++++++++++++++++++- .../renderer/components/text/TextProps.h | 5 +++++ .../renderer/components/text/TextShadowNode.h | 15 +++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactCommon/react/renderer/components/text/TextProps.cpp b/packages/react-native/ReactCommon/react/renderer/components/text/TextProps.cpp index 56ba3fbd30d7..b04c994865db 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/text/TextProps.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/text/TextProps.cpp @@ -7,6 +7,8 @@ #include "TextProps.h" +#include + namespace facebook::react { TextProps::TextProps( @@ -14,7 +16,19 @@ TextProps::TextProps( const TextProps& sourceProps, const RawProps& rawProps) : Props(context, sourceProps, rawProps), - BaseTextProps::BaseTextProps(context, sourceProps, rawProps) {}; + BaseTextProps::BaseTextProps(context, sourceProps, rawProps), + transform(convertRawProp( + context, + rawProps, + "transform", + sourceProps.transform, + {})), + transformOrigin(convertRawProp( + context, + rawProps, + "transformOrigin", + sourceProps.transformOrigin, + {})) {}; void TextProps::setProp( const PropsParserContext& context, @@ -23,6 +37,12 @@ void TextProps::setProp( const RawValue& value) { BaseTextProps::setProp(context, hash, propName, value); Props::setProp(context, hash, propName, value); + + static auto defaults = TextProps{}; + switch (hash) { + RAW_SET_PROP_SWITCH_CASE_BASIC(transform); + RAW_SET_PROP_SWITCH_CASE_BASIC(transformOrigin); + } } #pragma mark - DebugStringConvertible diff --git a/packages/react-native/ReactCommon/react/renderer/components/text/TextProps.h b/packages/react-native/ReactCommon/react/renderer/components/text/TextProps.h index 164a8e5358cd..f3101f8df6f6 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/text/TextProps.h +++ b/packages/react-native/ReactCommon/react/renderer/components/text/TextProps.h @@ -12,6 +12,7 @@ #include #include #include +#include namespace facebook::react { @@ -23,6 +24,10 @@ class TextProps : public Props, public BaseTextProps { void setProp(const PropsParserContext &context, RawPropsPropNameHash hash, const char *propName, const RawValue &value); + // View-level props that affect whether this text node needs a backing view + Transform transform{}; + TransformOrigin transformOrigin{}; + #pragma mark - DebugStringConvertible #if RN_DEBUG_STRING_CONVERTIBLE diff --git a/packages/react-native/ReactCommon/react/renderer/components/text/TextShadowNode.h b/packages/react-native/ReactCommon/react/renderer/components/text/TextShadowNode.h index 1fb00e59a255..f11047af137a 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/text/TextShadowNode.h +++ b/packages/react-native/ReactCommon/react/renderer/components/text/TextShadowNode.h @@ -42,6 +42,21 @@ class TextShadowNode : public ConcreteShadowNode::max(); } + using BaseShadowNode = ConcreteShadowNode; + + static ShadowNodeTraits getModifiedTraitsForText(const ShadowNodeFragment &fragment, ShadowNodeTraits traits) + { + auto textProps = std::static_pointer_cast(fragment.props); + if (textProps && !textProps->transform.operations.empty()) { + traits.set(ShadowNodeTraits::Trait::FormsView); + } + return traits; + } + + TextShadowNode(const ShadowNodeFragment &fragment, const ShadowNodeFamily::Shared &family, ShadowNodeTraits traits) + : BaseShadowNode(fragment, family, getModifiedTraitsForText(fragment, traits)), BaseTextShadowNode() + { + } #endif }; From 2269f4a88294cc68dc02712f447c77cb1e43deb7 Mon Sep 17 00:00:00 2001 From: Aditya kumar singh <143548997+Adityakk9031@users.noreply.github.com> Date: Mon, 9 Mar 2026 20:44:09 +0530 Subject: [PATCH 2/2] Update TextShadowNode.h --- .../renderer/components/text/TextShadowNode.h | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/react-native/ReactCommon/react/renderer/components/text/TextShadowNode.h b/packages/react-native/ReactCommon/react/renderer/components/text/TextShadowNode.h index f11047af137a..3bc6be1db960 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/text/TextShadowNode.h +++ b/packages/react-native/ReactCommon/react/renderer/components/text/TextShadowNode.h @@ -42,19 +42,21 @@ class TextShadowNode : public ConcreteShadowNode::max(); } +#else using BaseShadowNode = ConcreteShadowNode; - static ShadowNodeTraits getModifiedTraitsForText(const ShadowNodeFragment &fragment, ShadowNodeTraits traits) - { - auto textProps = std::static_pointer_cast(fragment.props); - if (textProps && !textProps->transform.operations.empty()) { - traits.set(ShadowNodeTraits::Trait::FormsView); - } - return traits; - } - TextShadowNode(const ShadowNodeFragment &fragment, const ShadowNodeFamily::Shared &family, ShadowNodeTraits traits) - : BaseShadowNode(fragment, family, getModifiedTraitsForText(fragment, traits)), BaseTextShadowNode() + : BaseShadowNode( + fragment, + family, + [&] { + auto textProps = std::static_pointer_cast(fragment.props); + if (textProps && !textProps->transform.operations.empty()) { + traits.set(ShadowNodeTraits::Trait::FormsView); + } + return traits; + }()), + BaseTextShadowNode() { } #endif