Skip to content

Commit 5ef0549

Browse files
SamChou19815facebook-github-bot
authored andcommitted
Turn on react.ref_as_prop=experimental.store_ref_in_props_but_remove_ref_in_react_element_config in fbsource (#53870)
Summary: Pull Request resolved: #53870 Changelog: [Internal] Reviewed By: jbrown215 Differential Revision: D82913848 fbshipit-source-id: c23f564404143535622fab3133d092d1fb566711
1 parent 71b7dd8 commit 5ef0549

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed

packages/react-native/Libraries/Animated/components/AnimatedImage.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ import Image from '../../Image/Image';
1414
import createAnimatedComponent from '../createAnimatedComponent';
1515
import * as React from 'react';
1616

17-
export default (createAnimatedComponent(
18-
(Image: $FlowFixMe),
19-
): AnimatedComponentType<
17+
export default (createAnimatedComponent<
18+
$FlowFixMe,
19+
React.ElementRef<typeof Image>,
20+
>((Image: $FlowFixMe)): AnimatedComponentType<
2021
React.ElementConfig<typeof Image>,
2122
React.ElementRef<typeof Image>,
2223
>);

packages/react-native/Libraries/Animated/components/AnimatedText.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ import Text, {type TextProps} from '../../Text/Text';
1414
import createAnimatedComponent from '../createAnimatedComponent';
1515
import * as React from 'react';
1616

17-
export default (createAnimatedComponent(
18-
(Text: $FlowFixMe),
19-
): AnimatedComponentType<TextProps, React.ElementRef<typeof Text>>);
17+
export default (createAnimatedComponent<
18+
$FlowFixMe,
19+
React.ElementRef<typeof Text>,
20+
>((Text: $FlowFixMe)): AnimatedComponentType<
21+
TextProps,
22+
React.ElementRef<typeof Text>,
23+
>);

packages/react-native/Libraries/Animated/components/AnimatedView.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ import View from '../../Components/View/View';
1515
import createAnimatedComponent from '../createAnimatedComponent';
1616
import * as React from 'react';
1717

18-
export default (createAnimatedComponent(View): AnimatedComponentType<
18+
// $FlowFixMe[incompatible-type]
19+
export default createAnimatedComponent(View) as AnimatedComponentType<
1920
ViewProps,
2021
React.ElementRef<typeof View>,
21-
>);
22+
>;

packages/react-native/Libraries/Components/ScrollView/ScrollView.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,6 +1690,7 @@ class ScrollView extends React.Component<ScrollViewProps, ScrollViewState> {
16901690
return (
16911691
<StickyHeaderComponent
16921692
key={key}
1693+
/* $FlowFixMe[incompatible-type] */
16931694
ref={ref => this._setStickyHeaderRef(key, ref)}
16941695
nextHeaderLayoutY={this._headerLayoutYs.get(
16951696
this._getKeyForIndex(nextIndex, children),

packages/react-native/Libraries/NativeComponent/NativeComponentRegistry.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,13 @@ export function getWithFallback_DEPRECATED<Config: {...}>(
129129
// `getRuntimeConfig == null` when static view configs are disabled
130130
// If `setRuntimeConfigProvider` is not configured, use native reflection.
131131
if (hasNativeViewConfig(name)) {
132+
/* $FlowFixMe[incompatible-type] Extra ref prop */
132133
return get<Config>(name, viewConfigProvider);
133134
}
134135
} else {
135136
// If there is no runtime config, then the native component is unavailable.
136137
if (getRuntimeConfig(name) != null) {
138+
/* $FlowFixMe[incompatible-type] Extra ref prop */
137139
return get<Config>(name, viewConfigProvider);
138140
}
139141
}

0 commit comments

Comments
 (0)