Skip to content

Commit e436815

Browse files
SamChou19815facebook-github-bot
authored andcommitted
Turn on react.ref_as_prop=experimental.store_ref_in_props
Summary: Changelog: [Internal] Reviewed By: marcoww6 Differential Revision: D82932016 fbshipit-source-id: a391bdc06eef60d3054b8440c4ccfbaf62bc931a
1 parent 4148746 commit e436815

3 files changed

Lines changed: 13 additions & 6 deletions

File tree

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ import FlatList, {type FlatListProps} from '../../Lists/FlatList';
1414
import createAnimatedComponent from '../createAnimatedComponent';
1515
import * as React from 'react';
1616

17-
// $FlowExpectedError[unclear-type]
18-
export default (createAnimatedComponent(FlatList): component<ItemT = any>(
17+
export default createAnimatedComponent(FlatList) as $FlowFixMe as component<
18+
// $FlowExpectedError[unclear-type]
19+
ItemT = any,
20+
>(
1921
ref?: React.RefSetter<FlatList<ItemT>>,
2022
...props: AnimatedProps<FlatListProps<ItemT>>
21-
));
23+
);

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

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

1717
// $FlowFixMe[incompatible-type]
18-
export default (createAnimatedComponent(SectionList): component<
18+
export default createAnimatedComponent(SectionList) as $FlowFixMe as component<
1919
// $FlowExpectedError[unclear-type]
2020
ItemT = any,
2121
// $FlowExpectedError[unclear-type]
2222
SectionT = any,
2323
>(
2424
ref?: React.RefSetter<SectionList<ItemT, SectionT>>,
2525
...props: AnimatedProps<SectionListProps<ItemT, SectionT>>
26-
));
26+
);

packages/rn-tester/js/examples/TextInput/ExampleTextInput.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,14 @@ import {RNTesterThemeContext} from '../../components/RNTesterTheme';
1212
import React, {useContext} from 'react';
1313
import {StyleSheet, TextInput} from 'react-native';
1414

15+
type LooseOmit<O: interface {}, K: $Keys<$FlowFixMe>> = Pick<
16+
O,
17+
Exclude<$Keys<O>, K>,
18+
>;
19+
1520
const ExampleTextInput: component(
1621
ref?: React.RefSetter<null | React.ElementRef<typeof TextInput>>,
17-
...props: React.ElementConfig<typeof TextInput>
22+
...props: LooseOmit<React.ElementProps<typeof TextInput>, 'ref'>
1823
) = ({
1924
ref,
2025
...props

0 commit comments

Comments
 (0)