Skip to content

Instantly share code, notes, and snippets.

@Louiefigz
Created June 27, 2017 01:51
Show Gist options
  • Save Louiefigz/dbfb566b267e1297de340a86cbbc26b9 to your computer and use it in GitHub Desktop.
Save Louiefigz/dbfb566b267e1297de340a86cbbc26b9 to your computer and use it in GitHub Desktop.
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