-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
41 lines (37 loc) · 1 KB
/
App.js
File metadata and controls
41 lines (37 loc) · 1 KB
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
32
33
34
35
36
37
38
39
40
41
import React, {Component} from 'react';
import { View } from 'react-native';
import { Root, Container, Header, Left, Body, Right, Title, Button, Toast , Text } from 'native-base'
export default class App extends Component {
state = {
counter: 0
}
incrementNumber = () => {
this.setState({ counter: this.state.counter + 1 });
Toast.show({
text: "Número atualizado!",
position: "bottom",
duration: 2000
})
}
render() {
return (
<Root>
<Container>
<Header>
<Left/>
<Body>
<Title>Fantastic Project</Title>
</Body>
<Right />
</Header>
<View style={{flex: 1, justifyContent: "center", alignItems:"center"}}>
<Text>{this.state.counter}</Text>
<Button onPress={this.incrementNumber} style={{alignSelf: "center", marginTop: 20}} rounded>
<Text>Incrementar!</Text>
</Button>
</View>
</Container>
</Root>
);
}
}