From 6e2b9daf7dbd683f6b6ce17ec5658deb014f0919 Mon Sep 17 00:00:00 2001 From: Fabrizio Cucci Date: Thu, 10 Oct 2024 07:01:29 -0700 Subject: [PATCH] Replace React.AbstractComponent with `component` type in VScrollViewNativeComponent (#46917) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/46917 Prepare for the ref-as-prop typing change in flow. Changelog: [Internal] Reviewed By: SamChou19815 Differential Revision: D64108764 fbshipit-source-id: 44cf9316a03bb18b658aeb45b7d951ad346ae3f0 --- .../private/components/VScrollViewNativeComponents.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/react-native/src/private/components/VScrollViewNativeComponents.js b/packages/react-native/src/private/components/VScrollViewNativeComponents.js index 89d17271f5b..41c691f23a4 100644 --- a/packages/react-native/src/private/components/VScrollViewNativeComponents.js +++ b/packages/react-native/src/private/components/VScrollViewNativeComponents.js @@ -23,11 +23,10 @@ import * as React from 'react'; import {forwardRef} from 'react'; // TODO: After upgrading to React 19, remove `forwardRef` from this component. -export const VScrollViewNativeComponent: React.AbstractComponent< - ScrollViewNativeProps, - TScrollViewNativeImperativeHandle, - // $FlowExpectedError[incompatible-type] - Flow cannot model imperative handles, yet. -> = forwardRef(function VScrollViewNativeComponent( +export const VScrollViewNativeComponent: component( + ref: React.RefSetter, + ...props: ScrollViewNativeProps +) = forwardRef(function VScrollViewNativeComponent( props: ScrollViewNativeProps, ref: ?React.RefSetter, ): React.Node {