Skip to content

Commit 3113e47

Browse files
Peter Arganyfacebook-github-bot
Peter Argany
authored andcommitted
Remove type union in PickeriOS/PickerNativeComponent
Summary: This builds on the last diff to remove type a type union from Picker. This diff focuses on Picker internals. Changelog: [JS] Remove type union in PickeriOS/PickerNativeComponent Reviewed By: sammy-SC Differential Revision: D24254615 fbshipit-source-id: f788a2e123135c1e8b9909870c40f53b2dea0227
1 parent b05d90e commit 3113e47

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Libraries/Components/Picker/PickerIOS.ios.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type PickerIOSChangeEvent = SyntheticEvent<
3737

3838
type RCTPickerIOSItemType = $ReadOnly<{|
3939
label: ?Label,
40-
value: ?(number | string),
40+
value: ?string,
4141
textColor: ?ProcessedColorValue,
4242
|}>;
4343

@@ -49,7 +49,7 @@ type Props = $ReadOnly<{|
4949
itemStyle?: ?TextStyleProp,
5050
onChange?: ?(event: PickerIOSChangeEvent) => mixed,
5151
onValueChange?: ?(itemValue: string | number, itemIndex: number) => mixed,
52-
selectedValue: ?(number | string),
52+
selectedValue: ?string,
5353
accessibilityLabel?: ?string,
5454
|}>;
5555

@@ -60,7 +60,7 @@ type State = {|
6060

6161
type ItemProps = $ReadOnly<{|
6262
label: ?Label,
63-
value?: ?(number | string),
63+
value?: ?string,
6464
color?: ?ColorValue,
6565
|}>;
6666

Libraries/Components/Picker/RCTPickerNativeComponent.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type PickerIOSChangeEvent = SyntheticEvent<
2828

2929
type RCTPickerIOSItemType = $ReadOnly<{|
3030
label: ?Label,
31-
value: ?(number | string),
31+
value: ?string,
3232
textColor: ?ProcessedColorValue,
3333
|}>;
3434

0 commit comments

Comments
 (0)