From 0b6fad6e7ac32d6eac9dd3760c24a5f985cfade2 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Mon, 18 May 2020 10:22:04 -0700 Subject: [PATCH] Pressable: Add Support for Inspector Overlay Summary: Adds support for the debug overlay (enabled via the Inspector) that the legacy touchable components supported. Changelog: [General][Added] - Added Inspector overlay support for Pressable Reviewed By: TheSavior Differential Revision: D21614412 fbshipit-source-id: b884e04f8dba1bfd35e61de25d33d6d47bc34b03 --- Libraries/Components/Pressable/Pressable.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Libraries/Components/Pressable/Pressable.js b/Libraries/Components/Pressable/Pressable.js index e86140b60f5..c35c9e3337a 100644 --- a/Libraries/Components/Pressable/Pressable.js +++ b/Libraries/Components/Pressable/Pressable.js @@ -22,6 +22,7 @@ import type { AccessibilityState, AccessibilityValue, } from '../View/ViewAccessibility'; +import {PressabilityDebugView} from '../../Pressability/PressabilityDebug'; import usePressability from '../../Pressability/usePressability'; import {normalizeRect, type RectOrSize} from '../../StyleSheet/Rect'; import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; @@ -220,6 +221,7 @@ function Pressable(props: Props, forwardedRef): React.Node { ref={viewRef} style={typeof style === 'function' ? style({pressed}) : style}> {typeof children === 'function' ? children({pressed}) : children} + {__DEV__ ? : null} ); }