Fix disabled behavior

Summary:
Changelog:
[General][Fixed] - Pass disabled prop to pressability config

Reviewed By: kacieb

Differential Revision: D26590399

fbshipit-source-id: dd4f8f25d1b243b2983cd4ffaadb5d3dc6f3ed3e
This commit is contained in:
Luna Wei
2021-02-22 16:56:48 -08:00
committed by Facebook GitHub Bot
parent c4aa411ee3
commit 33ff4445dc
+4 -1
View File
@@ -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(