-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
31 lines (29 loc) · 870 Bytes
/
App.js
File metadata and controls
31 lines (29 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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: '',anzahl:''};
}
handleChange(textvalue) {
this.setState({text: textvalue});
var arr_text = textvalue.split(' ');
this.setState({anzahl: arr_text.length});
}
render() {
return (
<View style={{padding: 10}}>
<TextInput
style={{height: 40, backgroundColor: 'azure', fontSize: 20}}
placeholder="Type here to translate!"
onChangeText={text =>{ this.handleChange(text)}}
/>
<Text>
ich schreibe geradedas: {this.state.text}
{"\n"}
so viel Wörter habe ich geschrieben {this.state.anzahl}
</Text>
</View>
);
}
}