From f808605b74b109e42369ebd05a1a04b3ceca1235 Mon Sep 17 00:00:00 2001 From: nd-02110114 Date: Sun, 4 Nov 2018 17:32:09 +0900 Subject: [PATCH 1/3] flow strict --- Libraries/Components/Picker/Picker.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Libraries/Components/Picker/Picker.js b/Libraries/Components/Picker/Picker.js index 88a70a59f6d05f..1087bd36c2405f 100644 --- a/Libraries/Components/Picker/Picker.js +++ b/Libraries/Components/Picker/Picker.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. * * @format - * @flow + * @flow strict-local */ 'use strict'; @@ -32,18 +32,18 @@ type PickerItemProps = $ReadOnly<{| * The value to be passed to picker's `onValueChange` callback when * this item is selected. Can be a string or an integer. */ - value?: any, + value?: ?(string | number), /** * Color of this item's text. * @platform android */ - color?: ColorValue, + color?: ?ColorValue, /** * Used to locate the item in end-to-end tests. */ - testID?: string, + testID?: ?string, |}>; /** @@ -63,14 +63,14 @@ type PickerProps = $ReadOnly<{| /** * Value matching value of one of the items. Can be a string or an integer. */ - selectedValue?: any, + selectedValue?: ?(string | number), /** * Callback for when an item is selected. This is called with the following parameters: * - `itemValue`: the `value` prop of the item that was selected * - `itemPosition`: the index of the selected item in this picker */ - onValueChange?: ?(newValue: any, newIndex: number) => mixed, + onValueChange?: ?(itemIndex: string, itemValue: string | number) => mixed, /** * If set to false, the picker will be disabled, i.e. the user will not be able to make a @@ -112,7 +112,7 @@ type PickerProps = $ReadOnly<{| * * this.setState({language: itemValue})}> + * onValueChange={(itemIndex, itemValue) => this.setState({language: itemValue})}> * * * From 1732a33abf973afa1cdf9df7aeb0df1d7d67cb86 Mon Sep 17 00:00:00 2001 From: nd-02110114 Date: Mon, 5 Nov 2018 11:23:38 +0900 Subject: [PATCH 2/3] fix --- Libraries/Components/Picker/Picker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Components/Picker/Picker.js b/Libraries/Components/Picker/Picker.js index 1087bd36c2405f..d838c115abcf3b 100644 --- a/Libraries/Components/Picker/Picker.js +++ b/Libraries/Components/Picker/Picker.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. * * @format - * @flow strict-local + * @flow */ 'use strict'; From 2ed58494b15c6f74756864582710f48da797b9c9 Mon Sep 17 00:00:00 2001 From: nd-02110114 Date: Mon, 5 Nov 2018 11:30:13 +0900 Subject: [PATCH 3/3] fix comment --- Libraries/Components/Picker/Picker.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/Components/Picker/Picker.js b/Libraries/Components/Picker/Picker.js index d838c115abcf3b..23048c54e745c1 100644 --- a/Libraries/Components/Picker/Picker.js +++ b/Libraries/Components/Picker/Picker.js @@ -68,9 +68,9 @@ type PickerProps = $ReadOnly<{| /** * Callback for when an item is selected. This is called with the following parameters: * - `itemValue`: the `value` prop of the item that was selected - * - `itemPosition`: the index of the selected item in this picker + * - `itemKey`: the key of the selected item in this picker */ - onValueChange?: ?(itemIndex: string, itemValue: string | number) => mixed, + onValueChange?: ?(itemKey: string, itemValue: string | number) => mixed, /** * If set to false, the picker will be disabled, i.e. the user will not be able to make a @@ -112,7 +112,7 @@ type PickerProps = $ReadOnly<{| * * this.setState({language: itemValue})}> + * onValueChange={(itemKey, itemValue) => this.setState({language: itemValue})}> * * *