-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.tsx
More file actions
46 lines (41 loc) · 1.36 KB
/
App.tsx
File metadata and controls
46 lines (41 loc) · 1.36 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
import React from "react";
import { View, StyleSheet, Button } from "react-native";
import { SafeAreaProvider } from "react-native-safe-area-context";
import AnimatedNumber from "./components/AnimatedNumber";
import Card from "./components/Card";
import Simultaneously from "./components/Simultaneously";
import useCachedResources from "./hooks/useCachedResources";
export default function App() {
const isLoadingComplete = useCachedResources();
const [value, setValue] = React.useState(123);
if (!isLoadingComplete) {
return null;
} else {
return (
<SafeAreaProvider>
<View style={styles.container}>
{/* <Card /> */}
{/* <Simultaneously /> */}
<AnimatedNumber value={value} />
<AnimatedNumber value={value + 12} />
<AnimatedNumber value={value + 22} />
<AnimatedNumber value={value + 132} />
<AnimatedNumber value={value + 142} />
<AnimatedNumber value={value + 152} />
<View style={{ marginTop: 20 }}>
<Button title="click +" onPress={() => setValue(value + 1)} />
<Button title="click -" onPress={() => setValue(value - 1)} />
</View>
</View>
</SafeAreaProvider>
);
}
}
const styles = StyleSheet.create({
// layout
container: {
flex: 1,
alignItems: "center",
justifyContent: "center",
},
});