diff --git a/packages/react-native/Libraries/Components/Pressable/Pressable.js b/packages/react-native/Libraries/Components/Pressable/Pressable.js index ef8dccaa830..de350029419 100644 --- a/packages/react-native/Libraries/Components/Pressable/Pressable.js +++ b/packages/react-native/Libraries/Components/Pressable/Pressable.js @@ -195,13 +195,16 @@ type Props = $ReadOnly<{| 'aria-label'?: ?string, |}>; +type Instance = React.ElementRef; + /** * Component used to build display components that should respond to whether the * component is currently pressed or not. */ -/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's - * LTI update could not be added via codemod */ -function Pressable(props: Props, forwardedRef): React.Node { +function Pressable( + props: Props, + forwardedRef: React.RefSetter, +): React.Node { const { accessible, accessibilityState, @@ -235,7 +238,7 @@ function Pressable(props: Props, forwardedRef): React.Node { ...restProps } = props; - const viewRef = useRef | null>(null); + const viewRef = useRef(null); const mergedRef = useMergeRefs(forwardedRef, viewRef); const android_rippleConfig = useAndroidRippleForView(android_ripple, viewRef);