@@ -16,7 +16,9 @@ import {StyleSheet} from 'react-native';
16
16
import type { SyntheticEvent } from 'react-native/Libraries/Types/CoreEventTypes' ;
17
17
import type { ViewProps } from 'react-native/Libraries/Components/View/ViewPropTypes' ;
18
18
19
- import RNCSegmentedControlNativeComponent from './RNCSegmentedControlNativeComponent' ;
19
+ import RNCSegmentedControlNativeComponent , {
20
+ type SegmentedControlIOSProps ,
21
+ } from './RNCSegmentedControlNativeComponent' ;
20
22
21
23
type Event = SyntheticEvent <
22
24
$ReadOnly < { |
@@ -25,42 +27,6 @@ type Event = SyntheticEvent<
25
27
| } > ,
26
28
> ;
27
29
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
-
64
30
type Props = $ReadOnly < { |
65
31
...SegmentedControlIOSProps ,
66
32
forwardedRef : ?React . Ref < typeof RNCSegmentedControlNativeComponent > ,
@@ -118,8 +84,10 @@ const styles = StyleSheet.create({
118
84
} ,
119
85
} ) ;
120
86
121
- // $FlowFixMe
122
- const SegmentedControlIOSWithRef = React . forwardRef (
87
+ const SegmentedControlIOSWithRef = React . forwardRef <
88
+ SegmentedControlIOSProps ,
89
+ RNCSegmentedControlNativeComponent,
90
+ > (
123
91
(
124
92
props : SegmentedControlIOSProps ,
125
93
forwardedRef : ?React . Ref < typeof RNCSegmentedControlNativeComponent > ,
0 commit comments