This commit is contained in:
Morten
2018-08-14 10:24:19 +02:00
commit 38b440e2f6
33 changed files with 12188 additions and 0 deletions

100
demo/App.js Normal file
View File

@@ -0,0 +1,100 @@
import React from 'react';
import {
StyleSheet,
Text,
View,
Button,
KeyboardAvoidingView,
SafeAreaView,
} from 'react-native';
import {
DevTool,
DevToolModal,
log,
network,
show,
} from 'react-native-debug-console';
network.attach();
log.attach();
console.log('fooo');
export default class App extends React.Component {
render() {
return (
<SafeAreaView style={styles.container}>
<KeyboardAvoidingView style={styles.wrapper} behavior="padding">
<Button
style={styles.button}
title="Console log"
onPress={() => {
console.log('hello');
}}
/>
<View style={{ height: 10 }} />
<Button
title="GET XHR"
style={styles.button}
onPress={() => {
const xhr = new XMLHttpRequest();
xhr.open('GET', 'https://google.com');
xhr.send();
}}
/>
<View style={{ height: 10 }} />
<Button
title="POST XHR"
style={styles.button}
onPress={() => {
const xhr = new XMLHttpRequest();
xhr.open('POST', 'https://google.com');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(JSON.stringify({
hello: 'world',
}));
}}
/>
<View style={{ height: 10 }} />
<Button
title="Break"
style={styles.button}
onPress={() => {
const err = new Error('some error');
throw err;
}}
/>
<View style={{ height: 30 }} />
<Button
title="Show"
style={styles.button}
onPress={() => {
show();
}}
/>
<View style={{ flex: 1 }} />
<DevTool
style={{
height: 300,
}}
/>
<DevToolModal />
</KeyboardAvoidingView>
</SafeAreaView>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#efefef',
},
wrapper: {
marginTop: 50,
flex: 1,
},
button: {
margin: 100,
},
});