From c8fd793cffedf7d7d4690d236f38aaaa40e7cd3a Mon Sep 17 00:00:00 2001 From: Fabrizio Cucci Date: Thu, 10 Oct 2024 10:59:58 -0700 Subject: [PATCH] Replace React.AbstractComponent with `component` type in ScrollViewStickyHeader (#46926) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/46926 Prepare for the ref-as-prop typing change in flow. Changelog: [Internal] Reviewed By: SamChou19815 Differential Revision: D64111478 fbshipit-source-id: 674316b9545dd12420e50f77cff6ac1c94783d4e --- .../Components/ScrollView/ScrollViewStickyHeader.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/ScrollView/ScrollViewStickyHeader.js b/packages/react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader.js index 052f01eb164..8386bec0cce 100644 --- a/packages/react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +++ b/packages/react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader.js @@ -38,10 +38,10 @@ type Instance = { ... }; -const ScrollViewStickyHeaderWithForwardedRef: React.AbstractComponent< - Props, - Instance, -> = React.forwardRef(function ScrollViewStickyHeader(props, forwardedRef) { +const ScrollViewStickyHeaderWithForwardedRef: component( + ref: React.RefSetter, + ...props: Props +) = React.forwardRef(function ScrollViewStickyHeader(props, forwardedRef) { const { inverted, scrollViewHeight, 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 ead966debb9..2c44b30437d 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 @@ -2396,10 +2396,10 @@ type Instance = { setNextHeaderY: (number) => void, ... }; -declare const ScrollViewStickyHeaderWithForwardedRef: React.AbstractComponent< - Props, - Instance, ->; +declare const ScrollViewStickyHeaderWithForwardedRef: component( + ref: React.RefSetter, + ...props: Props +); declare export default typeof ScrollViewStickyHeaderWithForwardedRef; " `;