diff --git a/packages/react-native/Libraries/Animated/components/AnimatedImage.js b/packages/react-native/Libraries/Animated/components/AnimatedImage.js index c178480fe73a41..8ecb4e0b5e750d 100644 --- a/packages/react-native/Libraries/Animated/components/AnimatedImage.js +++ b/packages/react-native/Libraries/Animated/components/AnimatedImage.js @@ -14,9 +14,10 @@ import Image from '../../Image/Image'; import createAnimatedComponent from '../createAnimatedComponent'; import * as React from 'react'; -export default (createAnimatedComponent( - (Image: $FlowFixMe), -): AnimatedComponentType< +export default (createAnimatedComponent< + $FlowFixMe, + React.ElementRef, +>((Image: $FlowFixMe)): AnimatedComponentType< React.ElementConfig, React.ElementRef, >); diff --git a/packages/react-native/Libraries/Animated/components/AnimatedText.js b/packages/react-native/Libraries/Animated/components/AnimatedText.js index d4223e7701922c..29e643a4f6adfb 100644 --- a/packages/react-native/Libraries/Animated/components/AnimatedText.js +++ b/packages/react-native/Libraries/Animated/components/AnimatedText.js @@ -14,6 +14,10 @@ import Text, {type TextProps} from '../../Text/Text'; import createAnimatedComponent from '../createAnimatedComponent'; import * as React from 'react'; -export default (createAnimatedComponent( - (Text: $FlowFixMe), -): AnimatedComponentType>); +export default (createAnimatedComponent< + $FlowFixMe, + React.ElementRef, +>((Text: $FlowFixMe)): AnimatedComponentType< + TextProps, + React.ElementRef, +>); diff --git a/packages/react-native/Libraries/Animated/components/AnimatedView.js b/packages/react-native/Libraries/Animated/components/AnimatedView.js index bd2a7875785e41..1779b4f0e908f8 100644 --- a/packages/react-native/Libraries/Animated/components/AnimatedView.js +++ b/packages/react-native/Libraries/Animated/components/AnimatedView.js @@ -15,7 +15,8 @@ import View from '../../Components/View/View'; import createAnimatedComponent from '../createAnimatedComponent'; import * as React from 'react'; -export default (createAnimatedComponent(View): AnimatedComponentType< +// $FlowFixMe[incompatible-type] +export default createAnimatedComponent(View) as AnimatedComponentType< ViewProps, React.ElementRef, ->); +>; diff --git a/packages/react-native/Libraries/Components/ScrollView/ScrollView.js b/packages/react-native/Libraries/Components/ScrollView/ScrollView.js index 179cd3320b1928..fdb830dc6e6244 100644 --- a/packages/react-native/Libraries/Components/ScrollView/ScrollView.js +++ b/packages/react-native/Libraries/Components/ScrollView/ScrollView.js @@ -1690,6 +1690,7 @@ class ScrollView extends React.Component { return ( this._setStickyHeaderRef(key, ref)} nextHeaderLayoutY={this._headerLayoutYs.get( this._getKeyForIndex(nextIndex, children), diff --git a/packages/react-native/Libraries/NativeComponent/NativeComponentRegistry.js b/packages/react-native/Libraries/NativeComponent/NativeComponentRegistry.js index 6152ffa2e81351..ba81528445bfcc 100644 --- a/packages/react-native/Libraries/NativeComponent/NativeComponentRegistry.js +++ b/packages/react-native/Libraries/NativeComponent/NativeComponentRegistry.js @@ -129,11 +129,13 @@ export function getWithFallback_DEPRECATED( // `getRuntimeConfig == null` when static view configs are disabled // If `setRuntimeConfigProvider` is not configured, use native reflection. if (hasNativeViewConfig(name)) { + /* $FlowFixMe[incompatible-type] Extra ref prop */ return get(name, viewConfigProvider); } } else { // If there is no runtime config, then the native component is unavailable. if (getRuntimeConfig(name) != null) { + /* $FlowFixMe[incompatible-type] Extra ref prop */ return get(name, viewConfigProvider); } }