From 3113e47b9bc92e3b0efb96db776f650848093dfc Mon Sep 17 00:00:00 2001 From: Peter Argany Date: Tue, 13 Oct 2020 11:13:34 -0700 Subject: [PATCH] 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 --- Libraries/Components/Picker/PickerIOS.ios.js | 6 +++--- Libraries/Components/Picker/RCTPickerNativeComponent.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Libraries/Components/Picker/PickerIOS.ios.js b/Libraries/Components/Picker/PickerIOS.ios.js index 39417c3c23b4d2..7f294019261a85 100644 --- a/Libraries/Components/Picker/PickerIOS.ios.js +++ b/Libraries/Components/Picker/PickerIOS.ios.js @@ -37,7 +37,7 @@ type PickerIOSChangeEvent = SyntheticEvent< type RCTPickerIOSItemType = $ReadOnly<{| label: ?Label, - value: ?(number | string), + value: ?string, textColor: ?ProcessedColorValue, |}>; @@ -49,7 +49,7 @@ type Props = $ReadOnly<{| itemStyle?: ?TextStyleProp, onChange?: ?(event: PickerIOSChangeEvent) => mixed, onValueChange?: ?(itemValue: string | number, itemIndex: number) => mixed, - selectedValue: ?(number | string), + selectedValue: ?string, accessibilityLabel?: ?string, |}>; @@ -60,7 +60,7 @@ type State = {| type ItemProps = $ReadOnly<{| label: ?Label, - value?: ?(number | string), + value?: ?string, color?: ?ColorValue, |}>; diff --git a/Libraries/Components/Picker/RCTPickerNativeComponent.js b/Libraries/Components/Picker/RCTPickerNativeComponent.js index ca42471b6025ce..70288d33132cf6 100644 --- a/Libraries/Components/Picker/RCTPickerNativeComponent.js +++ b/Libraries/Components/Picker/RCTPickerNativeComponent.js @@ -28,7 +28,7 @@ type PickerIOSChangeEvent = SyntheticEvent< type RCTPickerIOSItemType = $ReadOnly<{| label: ?Label, - value: ?(number | string), + value: ?string, textColor: ?ProcessedColorValue, |}>;