diff --git a/Libraries/Components/Picker/Picker.js b/Libraries/Components/Picker/Picker.js index 88a70a59f6d05f..23048c54e745c1 100644 --- a/Libraries/Components/Picker/Picker.js +++ b/Libraries/Components/Picker/Picker.js @@ -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 + * - `itemKey`: the key of the selected item in this picker */ - onValueChange?: ?(newValue: any, newIndex: 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})}> * * *