-
Notifications
You must be signed in to change notification settings - Fork 2
/
App.tsx
53 lines (48 loc) · 1.16 KB
/
App.tsx
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, {useState} from 'react';
import {Button, Dimensions, ScrollView, StyleSheet, View} from 'react-native';
const styles = StyleSheet.create({
container: {flexDirection: 'row', flexWrap: 'wrap'},
view: {
height: 20,
width: 20,
margin: 1,
backgroundColor: 'purple',
},
textContainer: {
position: 'absolute',
top: 0,
left: 0,
width: Dimensions.get('screen').width,
height: Dimensions.get('screen').height,
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
text: {
color: 'white',
fontSize: 5,
textAlign: 'center',
},
});
const App = () => {
const [show, setShow] = useState(false);
// Otherwise when importing directly I'm getting a crash
const SvgExample = require('./Svg').SvgExample;
return (
<>
<ScrollView>
<Button title="SHOW" onPress={() => setShow(!show)} />
{show ? (
<View style={styles.container}>
{Array(100)
.fill(null)
.map((_, index) => (
<SvgExample key={index} />
))}
</View>
) : null}
</ScrollView>
</>
);
};
export default App;