TextInput in React_Native
import React, {Component} from 'react';
import {AppRegistry, Text, TextInput, View} from 'react-native';
export default class PizzaTranslator extends Component {
constructor(props) {
super(props);
this.state = {text: ''};
}
render() {
return (
<View style={{padding: 10, backgroundColor: '#B5EAEA'}}>
<TextInput
style={{
height: 60,
backgroundColor: 'blue',
fontSize: 25,
}}
placeholder="Type Here to Tanslate!"
onChangeText={text => this.setState({text})}
/>
<View style={{backgroundColor: 'white', height: 600, top: 10}}>
<Text style={{padding: 40, fontSize: 50}}>
{this.state.text
.split(' ')
.map(word => word && '🍕')
.join(' ')}
</Text>
</View>
</View>
);
}
}
AppRegistry.registerComponent('AwesomeProject', () => Pizzatranslator);
Comments
Post a Comment
Please do not enter any spam link in the comment box.