-
-
Notifications
You must be signed in to change notification settings - Fork 359
Expand file tree
/
Copy pathindex.tsx
More file actions
112 lines (108 loc) · 2.81 KB
/
index.tsx
File metadata and controls
112 lines (108 loc) · 2.81 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import { Button, StyleSheet } from 'react-native';
import Constants from 'expo-constants';
import * as Sentry from '@sentry/react-native';
import { reloadAppAsync } from 'expo';
import { Text, View } from '@/components/Themed';
import { setScopeProperties } from '@/utils/setScopeProperties';
import React from 'react';
const isRunningInExpoGo = Constants.appOwnership === 'expo'
export default function TabOneScreen() {
return (
<View style={styles.container}>
<Sentry.TimeToInitialDisplay record />
<Text>Welcome to Sentry Expo Sample App!</Text>
<Button
title="Capture message"
onPress={() => {
Sentry.captureMessage('Captured message');
}}
/>
<Button
title="Capture exception"
onPress={() => {
Sentry.captureException(new Error('Captured exception'));
}}
/>
<Button
title="Capture exception with cause"
onPress={() => {
const error = new Error('Captured exception')
error.cause = new Error('Cause of captured exception')
Sentry.captureException(error);
}}
/>
<Button
title="Uncaught Thrown Error"
onPress={() => {
throw new Error('Uncaught Thrown Error');
}}
/>
<Button
title="Unhandled Promise Rejection"
onPress={() => {
// TODO: No working in Expo Go App
Promise.reject(new Error('Unhandled Promise Rejection'));
}}
/>
<Button
title="Native Crash"
onPress={() => {
if (isRunningInExpoGo) {
console.warn('Not supported in Expo Go. Build the application to test this feature.');
return;
}
Sentry.nativeCrash();
}}
/>
<Button
title="Show feedback form"
onPress={() => {
Sentry.showFeedbackForm();
}}
/>
<Button
title="Set Scope Properties"
onPress={() => {
setScopeProperties();
}}
/>
<Button
title="console.warn()"
onPress={() => {
console.warn('This is a warning.');
}}
/>
<Button
title="Flush"
onPress={async () => {
await Sentry.flush();
console.log('Sentry.flush() completed.');
}}
/>
<Button
title="Close"
onPress={async () => {
await Sentry.close();
console.log('Sentry.close() completed.');
}}
/>
<Button title="Reload" onPress={() => reloadAppAsync()} />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
title: {
fontSize: 20,
fontWeight: 'bold',
},
separator: {
marginVertical: 30,
height: 1,
width: '80%',
},
});