Created
June 27, 2017 01:51
-
-
Save Louiefigz/dbfb566b267e1297de340a86cbbc26b9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 { ScrollView, Text, StyleSheet, View, TextInput } from 'react-native'; | |
export default class App extends React.Component { | |
render() { | |
return ( | |
<View> | |
<TextInput | |
style={styles.input} | |
placeholder="Feed Me" | |
onChangeText={(text) => this.setState({text})} | |
/> | |
<View style={styles.background}> | |
<ScrollView > | |
{this.props.text.map((item)=> | |
<Text style={styles.font}>{item}</Text> | |
)} | |
</ScrollView> | |
</View> | |
</View> | |
); | |
} | |
} | |
const styles = StyleSheet.create({ | |
background:{ | |
alignItems: 'center' | |
}, | |
font:{ | |
fontSize: 30, | |
}, | |
input:{ | |
height: 40, marginTop:30, borderColor: 'gray', borderWidth: 1, textAlign: 'center' | |
} | |
}) | |
App.defaultProps = { | |
text: ['Burger King', 'McDonalds', 'Red Lobster', | |
'Dennys', 'Wendys', 'White Castle', 'popeyes'] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment