Skip to content

Commit cf94797

Browse files
fabriziocuccifacebook-github-bot
authored andcommitted
Resolve $FlowFixMe in Pressable (#44634)
Summary: Pull Request resolved: #44634 Changelog: [Internal] As per title. Reviewed By: NickGerleman Differential Revision: D57612982 fbshipit-source-id: 5aafd38889b3db49a5f4360563e1803169d9b943
1 parent e67d556 commit cf94797

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

  • packages/react-native/Libraries/Components/Pressable

packages/react-native/Libraries/Components/Pressable/Pressable.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,16 @@ type Props = $ReadOnly<{|
195195
'aria-label'?: ?string,
196196
|}>;
197197

198+
type Instance = React.ElementRef<typeof View>;
199+
198200
/**
199201
* Component used to build display components that should respond to whether the
200202
* component is currently pressed or not.
201203
*/
202-
/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's
203-
* LTI update could not be added via codemod */
204-
function Pressable(props: Props, forwardedRef): React.Node {
204+
function Pressable(
205+
props: Props,
206+
forwardedRef: React.RefSetter<Instance>,
207+
): React.Node {
205208
const {
206209
accessible,
207210
accessibilityState,
@@ -235,7 +238,7 @@ function Pressable(props: Props, forwardedRef): React.Node {
235238
...restProps
236239
} = props;
237240

238-
const viewRef = useRef<React.ElementRef<typeof View> | null>(null);
241+
const viewRef = useRef<Instance | null>(null);
239242
const mergedRef = useMergeRefs(forwardedRef, viewRef);
240243

241244
const android_rippleConfig = useAndroidRippleForView(android_ripple, viewRef);

0 commit comments

Comments
 (0)