-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
42 lines (33 loc) · 701 Bytes
/
Copy pathApp.js
File metadata and controls
42 lines (33 loc) · 701 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
32
33
34
35
36
37
38
39
40
41
42
import React from 'react';
import {
Button,
NativeModules,
View,
Text,
StyleSheet
} from 'react-native';
const MyToast = NativeModules.MyToastModule;
export default class App extends React.Component {
componentDidMount() {
}
buttonPressed(){
// show Toast message from Native
MyToast.showMessage("My second Message");
}
render() {
return (
<View style={styles.container}>
<Button onPress={() => this.buttonPressed()} title="Show Message">
</Button>
</View>
);
}
};
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "white",
justifyContent: 'center',
alignItems: 'center'
}
});