@@ -16,7 +16,9 @@ import {StyleSheet} from 'react-native';
1616import type { SyntheticEvent } from 'react-native/Libraries/Types/CoreEventTypes' ;
1717import type { ViewProps } from 'react-native/Libraries/Components/View/ViewPropTypes' ;
1818
19- import RNCSegmentedControlNativeComponent from './RNCSegmentedControlNativeComponent' ;
19+ import RNCSegmentedControlNativeComponent , {
20+ type SegmentedControlIOSProps ,
21+ } from './RNCSegmentedControlNativeComponent' ;
2022
2123type Event = SyntheticEvent <
2224 $ReadOnly < { |
@@ -25,42 +27,6 @@ type Event = SyntheticEvent<
2527 | } > ,
2628> ;
2729
28- type SegmentedControlIOSProps = $ReadOnly < { |
29- ...ViewProps ,
30- /**
31- * The labels for the control's segment buttons, in order.
32- */
33- values ?: $ReadOnlyArray < string > ,
34- /**
35- * The index in `props.values` of the segment to be (pre)selected.
36- */
37- selectedIndex ?: ?number ,
38- /**
39- * Callback that is called when the user taps a segment;
40- * passes the segment's value as an argument
41- */
42- onValueChange ?: ?( value : number ) => mixed ,
43- /**
44- * Callback that is called when the user taps a segment;
45- * passes the event as an argument
46- */
47- onChange ?: ?( event : Event ) => mixed ,
48- /**
49- * If false the user won't be able to interact with the control.
50- * Default value is true.
51- */
52- enabled ?: boolean ,
53- /**
54- * Accent color of the control.
55- */
56- tintColor ?: ?string ,
57- /**
58- * If true, then selecting a segment won't persist visually.
59- * The `onValueChange` callback will still work as expected.
60- */
61- momentary ?: ?boolean ,
62- | } > ;
63-
6430type Props = $ReadOnly < { |
6531 ...SegmentedControlIOSProps ,
6632 forwardedRef : ?React . Ref < typeof RNCSegmentedControlNativeComponent > ,
@@ -118,8 +84,10 @@ const styles = StyleSheet.create({
11884 } ,
11985} ) ;
12086
121- // $FlowFixMe
122- const SegmentedControlIOSWithRef = React . forwardRef (
87+ const SegmentedControlIOSWithRef = React . forwardRef <
88+ SegmentedControlIOSProps ,
89+ RNCSegmentedControlNativeComponent,
90+ > (
12391 (
12492 props : SegmentedControlIOSProps ,
12593 forwardedRef : ?React . Ref < typeof RNCSegmentedControlNativeComponent > ,
0 commit comments