diff --git a/packages/react-native/Libraries/Components/ScrollView/ScrollView.js b/packages/react-native/Libraries/Components/ScrollView/ScrollView.js index 95754d5cd36..e7fa9918a6b 100644 --- a/packages/react-native/Libraries/Components/ScrollView/ScrollView.js +++ b/packages/react-native/Libraries/Components/ScrollView/ScrollView.js @@ -1910,23 +1910,25 @@ function createRefForwarder( return state; } -// TODO: After upgrading to React 19, remove `forwardRef` from this component. // NOTE: This wrapper component is necessary because `ScrollView` is a class // component and we need to map `ref` to a differently named prop. This can be // removed when `ScrollView` is a functional component. const ScrollViewWrapper: component( ref?: React.RefSetter, ...props: ScrollViewProps -) = React.forwardRef(function Wrapper( - props: ScrollViewProps, - ref: ?React.RefSetter, -): React.Node { +) = function Wrapper({ + ref, + ...props +}: { + ref?: React.RefSetter, + ...ScrollViewProps, +}): React.Node { return ref == null ? ( ) : ( ); -}); +}; ScrollViewWrapper.displayName = 'ScrollView'; // $FlowExpectedError[prop-missing] ScrollViewWrapper.Context = ScrollViewContext;