mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Back out "Back out "[react-native][PR] remove defaultProps from picker of components""
Summary: Changelog: [Internal] - Remove defaultProps from Picker Reviewed By: TheSavior Differential Revision: D28941586 fbshipit-source-id: ca9efef597936badfd5c2920028ebd11dc7422a0
This commit is contained in:
committed by
Facebook GitHub Bot
parent
0aa8e25deb
commit
fc587c9e98
@@ -166,24 +166,24 @@ class Picker extends React.Component<PickerProps> {
|
||||
|
||||
static Item: typeof PickerItem = PickerItem;
|
||||
|
||||
static defaultProps: {|mode: $TEMPORARY$string<'dialog'>|} = {
|
||||
mode: MODE_DIALOG,
|
||||
};
|
||||
|
||||
render(): React.Node {
|
||||
const {mode = MODE_DIALOG, children, ...rest} = this.props;
|
||||
|
||||
if (Platform.OS === 'ios') {
|
||||
/* $FlowFixMe[prop-missing] (>=0.81.0 site=react_native_ios_fb) This
|
||||
* suppression was added when renaming suppression sites. */
|
||||
/* $FlowFixMe[incompatible-type] (>=0.81.0 site=react_native_ios_fb) This
|
||||
* suppression was added when renaming suppression sites. */
|
||||
return <PickerIOS {...this.props}>{this.props.children}</PickerIOS>;
|
||||
return <PickerIOS {...rest}>{children}</PickerIOS>;
|
||||
} else if (Platform.OS === 'android') {
|
||||
return (
|
||||
/* $FlowFixMe[incompatible-type] (>=0.81.0 site=react_native_android_fb) This
|
||||
* suppression was added when renaming suppression sites. */
|
||||
/* $FlowFixMe[prop-missing] (>=0.81.0 site=react_native_android_fb) This
|
||||
* suppression was added when renaming suppression sites. */
|
||||
<PickerAndroid {...this.props}>{this.props.children}</PickerAndroid>
|
||||
<PickerAndroid mode={mode} {...rest}>
|
||||
{children}
|
||||
</PickerAndroid>
|
||||
);
|
||||
} else {
|
||||
return <UnimplementedView />;
|
||||
|
||||
@@ -64,7 +64,6 @@ exports[`<Picker /> should render as expected: should deep render when not mocke
|
||||
|
||||
exports[`<Picker /> should render as expected: should shallow render as <Picker /> when mocked 1`] = `
|
||||
<Picker
|
||||
mode="dialog"
|
||||
onValueChange={[MockFunction]}
|
||||
selectedValue="foo"
|
||||
>
|
||||
@@ -81,7 +80,6 @@ exports[`<Picker /> should render as expected: should shallow render as <Picker
|
||||
|
||||
exports[`<Picker /> should render as expected: should shallow render as <Picker /> when not mocked 1`] = `
|
||||
<Picker
|
||||
mode="dialog"
|
||||
onValueChange={[MockFunction]}
|
||||
selectedValue="foo"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user