Skip to content

Commit

Permalink
Lint fix2
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahulkishanm authored Mar 20, 2019
1 parent be7db85 commit 44f0620
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions Libraries/Components/Picker/PickerIOS.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,31 @@
* @flow
*/

'use strict';
"use strict";

const React = require('React');
const ReactNative = require('ReactNative');
const StyleSheet = require('StyleSheet');
const View = require('View');
const processColor = require('processColor');
const RCTPickerNativeComponent = require('RCTPickerNativeComponent');
const React = require("React");
const ReactNative = require("ReactNative");
const StyleSheet = require("StyleSheet");
const View = require("View");
const processColor = require("processColor");
const RCTPickerNativeComponent = require("RCTPickerNativeComponent");

import type {SyntheticEvent} from 'CoreEventTypes';
import type {ColorValue} from 'StyleSheetTypes';
import type {ViewProps} from 'ViewPropTypes';
import type {TextStyleProp} from 'StyleSheet';
import type { SyntheticEvent } from "CoreEventTypes";
import type { ColorValue } from "StyleSheetTypes";
import type { ViewProps } from "ViewPropTypes";
import type { TextStyleProp } from "StyleSheet";

type PickerIOSChangeEvent = SyntheticEvent<
$ReadOnly<{|
newValue: number | string,
newIndex: number,
|}>,
newIndex: number
|}>
>;

type RCTPickerIOSItemType = $ReadOnly<{|
label: ?Label,
value: ?(number | string),
textColor: ?number,
textColor: ?number
|}>;

type RCTPickerIOSType = Class<
Expand All @@ -47,9 +47,9 @@ type RCTPickerIOSType = Class<
onStartShouldSetResponder: () => boolean,
selectedIndex: number,
style?: ?TextStyleProp,
testID?: ?string,
|}>,
>,
testID?: ?string
|}>
>
>;

type Label = Stringish | number;
Expand All @@ -60,18 +60,18 @@ type Props = $ReadOnly<{|
itemStyle?: ?TextStyleProp,
onChange?: ?(event: PickerIOSChangeEvent) => mixed,
onValueChange?: ?(itemValue: string | number, itemIndex: number) => mixed,
selectedValue: ?(number | string),
selectedValue: ?(number | string)
|}>;

type State = {|
selectedIndex: number,
items: $ReadOnlyArray<RCTPickerIOSItemType>,
items: $ReadOnlyArray<RCTPickerIOSItemType>
|};

type ItemProps = $ReadOnly<{|
label: ?Label,
value?: ?(number | string),
color?: ?ColorValue,
color?: ?ColorValue
|}>;

const PickerIOSItem = (props: ItemProps) => {
Expand All @@ -83,7 +83,7 @@ class PickerIOS extends React.Component<Props, State> {

state = {
selectedIndex: 0,
items: [],
items: []
};

static Item = PickerIOSItem;
Expand All @@ -92,18 +92,18 @@ class PickerIOS extends React.Component<Props, State> {
let selectedIndex = 0;
const items = [];
React.Children.toArray(props.children)
.filter(child => child != null)
.filter(child => child !== null)
.forEach(function(child, index) {
if (child.props.value === props.selectedValue) {
selectedIndex = index;
}
items.push({
value: child.props.value,
label: child.props.label,
textColor: processColor(child.props.color),
if (child.props.value === props.selectedValue) {
selectedIndex = index;
}
items.push({
value: child.props.value,
label: child.props.label,
textColor: processColor(child.props.color)
});
});
});
return {selectedIndex, items};
return { selectedIndex, items };
}

render() {
Expand Down Expand Up @@ -132,7 +132,7 @@ class PickerIOS extends React.Component<Props, State> {
if (this.props.onValueChange) {
this.props.onValueChange(
event.nativeEvent.newValue,
event.nativeEvent.newIndex,
event.nativeEvent.newIndex
);
}

Expand All @@ -147,7 +147,7 @@ class PickerIOS extends React.Component<Props, State> {
this.state.selectedIndex !== event.nativeEvent.newIndex
) {
this._picker.setNativeProps({
selectedIndex: this.state.selectedIndex,
selectedIndex: this.state.selectedIndex
});
}
};
Expand All @@ -158,8 +158,8 @@ const styles = StyleSheet.create({
// The picker will conform to whatever width is given, but we do
// have to set the component's height explicitly on the
// surrounding view to ensure it gets rendered.
height: 216,
},
height: 216
}
});

module.exports = PickerIOS;

0 comments on commit 44f0620

Please sign in to comment.