From 2bc25be88c85a343e3100705f1439df5440fcc6f Mon Sep 17 00:00:00 2001 From: Sam Zhou Date: Thu, 10 Oct 2024 08:19:34 -0700 Subject: [PATCH] Replace last React.Ref type usage in react-native (#46931) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/46931 Prepare for deletion of this deprecated type that contain support for string ref in the next flow release. Changelog: [Internal] Reviewed By: rshest Differential Revision: D64127228 fbshipit-source-id: 9d3a1c0e6303efb35a540349fdc8e42b7b70be8b --- packages/react-native/Libraries/Image/ImageProps.js | 4 ++-- .../Libraries/__tests__/__snapshots__/public-api-test.js.snap | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-native/Libraries/Image/ImageProps.js b/packages/react-native/Libraries/Image/ImageProps.js index d0413779364..c0c39075872 100644 --- a/packages/react-native/Libraries/Image/ImageProps.js +++ b/packages/react-native/Libraries/Image/ImageProps.js @@ -20,7 +20,7 @@ import type { import type {LayoutEvent, SyntheticEvent} from '../Types/CoreEventTypes'; import typeof Image from './Image'; import type {ImageSource} from './ImageSource'; -import type {Node, Ref} from 'react'; +import type {ElementRef, Node, RefSetter} from 'react'; export type ImageLoadEvent = SyntheticEvent< $ReadOnly<{| @@ -291,5 +291,5 @@ export type ImageBackgroundProps = $ReadOnly<{| * * See https://reactnative.dev/docs/imagebackground#imageref */ - imageRef?: Ref, + imageRef?: RefSetter>, |}>; diff --git a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap index 9be2ac6383d..db1579ed5b8 100644 --- a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap +++ b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap @@ -4880,7 +4880,7 @@ export type ImageBackgroundProps = $ReadOnly<{| children?: Node, style?: ?ViewStyleProp, imageStyle?: ?ImageStyleProp, - imageRef?: Ref, + imageRef?: RefSetter>, |}>; " `;