This repository was archived by the owner on Jan 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.android.js
More file actions
53 lines (45 loc) · 1.46 KB
/
index.android.js
File metadata and controls
53 lines (45 loc) · 1.46 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
42
43
44
45
46
47
48
49
50
51
52
53
import React, { Component } from 'react';
import { AppRegistry, StyleSheet, Text, View, Button, Modal, ActivityIndicator } from 'react-native';
import { CustomModal } from "./workaroundModal";
export default class Crasher extends Component {
constructor() {
super();
this.state = { showModal: false, showWorkAroundModal: false };
}
render() {
return (
<View style={styles.container}>
<Button onPress={this.showModal} title="DONT CLICK ME!" color="red" />
<Button onPress={this.showWorkAroundModal} title="SAFE TO CLICK ME!" color="green" />
<Modal visible={this.state.showModal} onRequestClose={() => { } }>
<Text>Master, I`m here to serve...</Text>
</Modal>
<CustomModal visible={this.state.showWorkAroundModal} onRequestClose={() => { } }>
<Text>Master, I`m here to serve...</Text>
</CustomModal>
</View>
);
}
showModal = () => {
this.setState({ showModal: true });
setTimeout(this.hideModal, 1);
}
hideModal = () => {
this.setState({ showModal: false });
}
showWorkAroundModal = () => {
this.setState({ showWorkAroundModal: true });
setTimeout(this.hideWorkAroundModal, 1);
}
hideWorkAroundModal = () => {
this.setState({ showWorkAroundModal: false });
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center'
}
});
AppRegistry.registerComponent('RNCrashBug', () => Crasher);