Skip to content

Commit bb1131c

Browse files
committed
Update Picker value prop type
1 parent 7e0281d commit bb1131c

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/components/picker/index.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@ const PICKER_MODES = {
1717
SINGLE: 'SINGLE',
1818
MULTI: 'MULTI'
1919
};
20-
const ItemType = PropTypes.shape({
21-
value: PropTypes.any,
22-
label: PropTypes.string
23-
});
20+
const ItemType = PropTypes.oneOfType([
21+
PropTypes.number,
22+
PropTypes.string,
23+
PropTypes.shape({
24+
value: PropTypes.any,
25+
label: PropTypes.string
26+
})]);
2427

2528
/**
2629
* @description: Picker Component, support single or multiple selection, blurModel and nativePicker
@@ -163,9 +166,7 @@ class Picker extends PureComponent {
163166
// console.warn('UILib Picker: don\'t use object as value for native picker, use either string or a number');
164167
// }
165168
if (_.isPlainObject(props.value)) {
166-
LogService.warn(
167-
'UILib Picker will stop supporting passing object as value in the next major version. Please use either string or a number as value'
168-
);
169+
LogService.warn('UILib Picker will stop supporting passing object as value in the next major version. Please use either string or a number as value');
169170
}
170171
}
171172

0 commit comments

Comments
 (0)