From c323dbbcbe66ff7ee271968211c9db206c85b1ff Mon Sep 17 00:00:00 2001 From: Eric Rozell Date: Fri, 13 Oct 2023 06:19:44 -0700 Subject: [PATCH] Parse isPressable from BaseTextProps (#40880) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/40880 The isPressable prop was previously added to TextAttributes. It also needs to be parsed from RawProps in BaseTextProps for platforms to use it. ## Changelog [General][Internal] Reviewed By: javache Differential Revision: D50235306 fbshipit-source-id: 101aded2af5889c739ed06af7511bd34a2683dfc --- .../react/renderer/components/text/BaseTextProps.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/react-native/ReactCommon/react/renderer/components/text/BaseTextProps.cpp b/packages/react-native/ReactCommon/react/renderer/components/text/BaseTextProps.cpp index 2e6347a7510..cb5a93b703f 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/text/BaseTextProps.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/text/BaseTextProps.cpp @@ -165,6 +165,12 @@ static TextAttributes convertRawProp( "isHighlighted", sourceTextAttributes.isHighlighted, defaultTextAttributes.isHighlighted); + textAttributes.isPressable = convertRawProp( + context, + rawProps, + "isPressable", + sourceTextAttributes.isPressable, + defaultTextAttributes.isPressable); // In general, we want this class to access props in the same order // that ViewProps accesses them in, so that RawPropParser can optimize @@ -294,6 +300,8 @@ void BaseTextProps::setProp( defaults, value, textAttributes, textShadowColor, "textShadowColor"); REBUILD_FIELD_SWITCH_CASE( defaults, value, textAttributes, isHighlighted, "isHighlighted"); + REBUILD_FIELD_SWITCH_CASE( + defaults, value, textAttributes, isPressable, "isPressable"); REBUILD_FIELD_SWITCH_CASE( defaults, value,