mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Make use of ref-as-prop support in ProgressBarAndroid (#51362)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/51362 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: D74814465 fbshipit-source-id: 7264e137040381621dddc2641fb31114273cfb28
This commit is contained in:
1 parent
6129d3c48e
commit
aecd6f1079
1 file changed
+14
-13
+14
-13
@@ -39,23 +39,24 @@ export type {ProgressBarAndroidProps};
|
||||
* },
|
||||
* ```
|
||||
*/
|
||||
const ProgressBarAndroidWithForwardedRef: component(
|
||||
const ProgressBarAndroid: component(
|
||||
ref?: React.RefSetter<
|
||||
React.ElementRef<typeof ProgressBarAndroidNativeComponent>,
|
||||
>,
|
||||
...props: ProgressBarAndroidProps
|
||||
) = React.forwardRef(function ProgressBarAndroid(
|
||||
{
|
||||
// $FlowFixMe[incompatible-type]
|
||||
styleAttr = 'Normal',
|
||||
indeterminate = true,
|
||||
animating = true,
|
||||
...restProps
|
||||
}: ProgressBarAndroidProps,
|
||||
forwardedRef: ?React.RefSetter<
|
||||
) = function ProgressBarAndroid({
|
||||
ref: forwardedRef,
|
||||
// $FlowFixMe[incompatible-type]
|
||||
styleAttr = 'Normal',
|
||||
indeterminate = true,
|
||||
animating = true,
|
||||
...restProps
|
||||
}: {
|
||||
ref?: React.RefSetter<
|
||||
React.ElementRef<typeof ProgressBarAndroidNativeComponent>,
|
||||
>,
|
||||
) {
|
||||
...ProgressBarAndroidProps,
|
||||
}) {
|
||||
return (
|
||||
<ProgressBarAndroidNativeComponent
|
||||
styleAttr={styleAttr}
|
||||
@@ -65,6 +66,6 @@ const ProgressBarAndroidWithForwardedRef: component(
|
||||
ref={forwardedRef}
|
||||
/>
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
export default ProgressBarAndroidWithForwardedRef;
|
||||
export default ProgressBarAndroid;
|
||||
Reference in new issue
Block a user