Last active
April 22, 2017 15:56
-
-
Save edutrul/af8a876f6f1b7fc3bddea03f3d541999 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, { Component } from 'react'; | |
import { AppRegistry, Text, TextInput, View } from 'react-native'; | |
class PizzaTranslator extends Component { | |
constructor(props) { | |
super(props); | |
this.state = {text: ''}; | |
} | |
render() { | |
return ( | |
<View style={{padding: 10}}> | |
<TextInput | |
style={{height: 40}} | |
placeholder="Type here to translate!" | |
onChangeText={(text) => this.setState({text})} | |
/> | |
<Text style={{padding: 10, fontSize: 42}}> | |
{this.state.text.split(' ').map((word) => word && '🍕').join(' ')} | |
</Text> | |
</View> | |
); | |
} | |
} | |
AppRegistry.registerComponent('PizzaTranslator', () => PizzaTranslator); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment