From 33ff4445dcf858cd5e6ba899163fd2a76774b641 Mon Sep 17 00:00:00 2001 From: Luna Wei Date: Mon, 22 Feb 2021 16:54:04 -0800 Subject: [PATCH] Fix disabled behavior Summary: Changelog: [General][Fixed] - Pass disabled prop to pressability config Reviewed By: kacieb Differential Revision: D26590399 fbshipit-source-id: dd4f8f25d1b243b2983cd4ffaadb5d3dc6f3ed3e --- Libraries/Text/Text.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Libraries/Text/Text.js b/Libraries/Text/Text.js index 385164ea4ad116..1b334d3fda0a70 100644 --- a/Libraries/Text/Text.js +++ b/Libraries/Text/Text.js @@ -48,7 +48,10 @@ const Text: React.AbstractComponent< const [isHighlighted, setHighlighted] = useState(false); const isPressable = - onPress != null || onLongPress != null || onStartShouldSetResponder != null; + (onPress != null || + onLongPress != null || + onStartShouldSetResponder != null) && + restProps.disabled !== true; const initialized = useLazyInitialization(isPressable); const config = useMemo(