Make use of ref-as-prop support in TouchableBounce (#51369)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51369

Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74815336

fbshipit-source-id: b45f563ee73bd53794319b0d9886d3214caf0544
This commit is contained in:
Sam Zhou
2025-05-15 14:25:37 -07:00
committed by Facebook GitHub Bot
parent 0312e9968c
commit 6129d3c48e
@@ -221,9 +221,15 @@ class TouchableBounce extends React.Component<
}
}
export default (React.forwardRef((props, hostRef: React.RefSetter<mixed>) => (
<TouchableBounce {...props} hostRef={hostRef} />
)): component(
export default (function TouchableBounceWrapper({
ref: hostRef,
...props
}: {
ref: React.RefSetter<mixed>,
...$ReadOnly<Omit<TouchableBounceProps, 'hostRef'>>,
}) {
return <TouchableBounce {...props} hostRef={hostRef} />;
} as component(
ref: React.RefSetter<mixed>,
...props: $ReadOnly<Omit<TouchableBounceProps, 'hostRef'>>
));