-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Standalone for NativeComponents] AndroidDropdownPicker and AndroidDialogPicker #22999
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* 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 strict-local | ||
*/ | ||
|
||
'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 DialogPickerNativeType = Class<NativeComponent<NativeProps>>; | ||
|
||
module.exports = ((requireNativeComponent( | ||
'AndroidDialogPicker', | ||
): any): DialogPickerNativeType); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unclear type. Using |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* 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 strict-local | ||
*/ | ||
|
||
'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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unclear type. Using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unclear type. Using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unclear type. Using
any
,Object
, orFunction
types is not safe! (unclear-type
)