-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathApp.js
59 lines (55 loc) · 1.31 KB
/
App.js
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
import { Map } from 'immutable';
import React, { Component } from 'react';
import { SafeAreaView, ScrollView, StyleSheet } from 'react-native';
import JSONTree from 'react-native-json-tree';
import Heading from './Heading';
const styles = StyleSheet.create({
container: { flex: 1 },
title: { margin: 10 },
});
const exampleJson = {
array: [1, 2, 3],
emptyArray: [],
emptyObject: {},
bool: true,
date: new Date(),
smallObject: {
yes: false,
zero: 1,
empty: 'string',
},
nestedObject: {
baz: undefined,
clazz: function User() {},
foo: {
nested: {
deepValue: 'Hello',
levels: 2,
tooMany: true,
nested: {
deeper: {
some: {
very: 'deep value',
},
},
},
},
},
},
immutable: Map({ key: 'value' }), // eslint-disable-line new-cap
hugeArray: Array.from({ length: 100 }).map((_, i) => `item #${i}`),
longString: 'Loremipsumdolorsitamet,consecteturadipiscingelit.Namtempusipsumutfelisdig',
};
class App extends Component {
render() {
return (
<SafeAreaView style={styles.container}>
<ScrollView>
<Heading>react-native-json-tree</Heading>
<JSONTree data={exampleJson} />
</ScrollView>
</SafeAreaView>
);
}
}
export default App;