mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-05 11:19:34 +00:00
committed by
Nicolas Gallagher
parent
2b5ddf753e
commit
744aaa26d4
+7
-3
@@ -18,10 +18,11 @@ import StyleSheetPropType from '../../modules/StyleSheetPropType';
|
|||||||
import StyleSheet from '../StyleSheet';
|
import StyleSheet from '../StyleSheet';
|
||||||
import TextPropTypes from '../Text/TextPropTypes';
|
import TextPropTypes from '../Text/TextPropTypes';
|
||||||
import { arrayOf, bool, func, number, oneOfType, string } from 'prop-types';
|
import { arrayOf, bool, func, number, oneOfType, string } from 'prop-types';
|
||||||
|
import ViewPropTypes, { type ViewProps } from '../ViewPropTypes';
|
||||||
|
|
||||||
const pickerStyleType = StyleSheetPropType(PickerStylePropTypes);
|
const pickerStyleType = StyleSheetPropType(PickerStylePropTypes);
|
||||||
|
|
||||||
type Props = {
|
type Props = ViewProps & {
|
||||||
children?: PickerItem | Array<typeof PickerItem>,
|
children?: PickerItem | Array<typeof PickerItem>,
|
||||||
enabled?: boolean,
|
enabled?: boolean,
|
||||||
onValueChange?: Function,
|
onValueChange?: Function,
|
||||||
@@ -36,6 +37,7 @@ type Props = {
|
|||||||
|
|
||||||
class Picker extends Component<Props> {
|
class Picker extends Component<Props> {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
...ViewPropTypes,
|
||||||
children: oneOfType([PickerItemPropType, arrayOf(PickerItemPropType)]),
|
children: oneOfType([PickerItemPropType, arrayOf(PickerItemPropType)]),
|
||||||
enabled: bool,
|
enabled: bool,
|
||||||
onValueChange: func,
|
onValueChange: func,
|
||||||
@@ -56,8 +58,9 @@ class Picker extends Component<Props> {
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
itemStyle,
|
itemStyle,
|
||||||
mode,
|
mode,
|
||||||
prompt
|
prompt,
|
||||||
/* eslint-enable */
|
/* eslint-enable */
|
||||||
|
...otherProps
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
return createElement('select', {
|
return createElement('select', {
|
||||||
@@ -66,7 +69,8 @@ class Picker extends Component<Props> {
|
|||||||
onChange: this._handleChange,
|
onChange: this._handleChange,
|
||||||
style: [styles.initial, style],
|
style: [styles.initial, style],
|
||||||
testID,
|
testID,
|
||||||
value: selectedValue
|
value: selectedValue,
|
||||||
|
...otherProps
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ const PickerScreen = () => (
|
|||||||
<AppText>Renders the native <select> component.</AppText>
|
<AppText>Renders the native <select> component.</AppText>
|
||||||
</Description>
|
</Description>
|
||||||
<Section title="Props">
|
<Section title="Props">
|
||||||
|
<DocItem name="...View props" />
|
||||||
|
|
||||||
<DocItem
|
<DocItem
|
||||||
name="children"
|
name="children"
|
||||||
typeInfo="?Array<Picker.Item>"
|
typeInfo="?Array<Picker.Item>"
|
||||||
|
|||||||
Reference in New Issue
Block a user