Last active
August 16, 2018 06:58
-
-
Save Karniej/86082a5d09e8147dacedb23b5e5aa7f5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { View, Text, Picker, Platform } from 'react-native'; | |
class MyPicker extends React.Component { | |
state = { | |
system: '' | |
}; | |
render() { | |
return ( | |
<View style={{ justifyContent: 'center', alignItems: 'center', flex: 1 }}> | |
<Text>React Native Picker{' '}{Platform.select({ android: 'Android', ios: 'IOS' })}</Text> | |
<Picker | |
selectedValue={this.state.system} | |
style={{ height: 50, width: 100 }} | |
onValueChange={itemValue => this.setState({ system: itemValue })} | |
itemstyle={{ width: 100 }} | |
> | |
<Picker.Item label="IOS" value="IOS" /> | |
<Picker.Item label="Android" value="Android" /> | |
</Picker> | |
</View> | |
); | |
} | |
} | |
export default MyPicker; |
line 12, it does not look aesthetic - it could be a one-line string
please apply the formatting to this file - you can choose the extension when creating a gist file
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
lines 5-26, please indent :D @Karniej