mirror of
https://github.com/status-im/react-native.git
synced 2025-02-23 22:58:19 +00:00
Summary: Changelog: ---------- [Android] [Changed] - As mentioned in #22990, I have moved native components required by PickerAndroid.android.js into separate files and added Flow Typing. Pull Request resolved: https://github.com/facebook/react-native/pull/22999 Differential Revision: D13697130 Pulled By: TheSavior fbshipit-source-id: 42da73d82cca45fefa066871eed5a637811643c8
48 lines
1.1 KiB
JavaScript
48 lines
1.1 KiB
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
* @flow
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
const requireNativeComponent = require('requireNativeComponent');
|
|
|
|
import type {SyntheticEvent} from 'CoreEventTypes';
|
|
import type {TextStyleProp} from 'StyleSheet';
|
|
import type {NativeComponent} from 'ReactNative';
|
|
|
|
type PickerAndroidChangeEvent = SyntheticEvent<
|
|
$ReadOnly<{|
|
|
position: number,
|
|
|}>,
|
|
>;
|
|
|
|
type Item = $ReadOnly<{|
|
|
label: string,
|
|
value: ?(number | string),
|
|
color?: ?number,
|
|
|}>;
|
|
|
|
type NativeProps = $ReadOnly<{|
|
|
enabled?: ?boolean,
|
|
items: $ReadOnlyArray<Item>,
|
|
mode?: ?('dialog' | 'dropdown'),
|
|
onSelect?: (event: PickerAndroidChangeEvent) => void,
|
|
selected: number,
|
|
prompt?: ?string,
|
|
testID?: string,
|
|
style?: ?TextStyleProp,
|
|
accessibilityLabel?: ?string,
|
|
|}>;
|
|
|
|
type DropdownPickerNativeType = Class<NativeComponent<NativeProps>>;
|
|
|
|
module.exports = ((requireNativeComponent(
|
|
'AndroidDropdownPicker',
|
|
): any): DropdownPickerNativeType);
|