From c09f824962dbb873a3ba08adf0f435462c378770 Mon Sep 17 00:00:00 2001 From: Fabrizio Cucci Date: Fri, 11 Oct 2024 06:53:43 -0700 Subject: [PATCH] Replace React.AbstractComponent with `component` type in ActivityIndicator (#46951) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/46951 Prepare for the ref-as-prop typing change in flow. Changelog: [Internal] Reviewed By: cortinico Differential Revision: D64175898 fbshipit-source-id: 4db76dda0c4ac604c38dc3acf5bc39448cad006e --- .../Components/ActivityIndicator/ActivityIndicator.js | 8 ++++---- .../__tests__/__snapshots__/public-api-test.js.snap | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js b/packages/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js index 7f724524add5ce..8cdceda9e9a8af 100644 --- a/packages/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js +++ b/packages/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js @@ -153,10 +153,10 @@ const ActivityIndicator = ( ``` */ -const ActivityIndicatorWithRef: React.AbstractComponent< - Props, - HostComponent, -> = React.forwardRef(ActivityIndicator); +const ActivityIndicatorWithRef: component( + ref: React.RefSetter>, + ...props: Props +) = React.forwardRef(ActivityIndicator); ActivityIndicatorWithRef.displayName = 'ActivityIndicator'; const styles = StyleSheet.create({ 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 b69166a6ffed25..895b81f3bd281f 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 @@ -1657,10 +1657,10 @@ type Props = $ReadOnly<{| color?: ?ColorValue, size?: ?IndicatorSize, |}>; -declare const ActivityIndicatorWithRef: React.AbstractComponent< - Props, - HostComponent, ->; +declare const ActivityIndicatorWithRef: component( + ref: React.RefSetter>, + ...props: Props +); declare export default typeof ActivityIndicatorWithRef; " `;