-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
29 lines (26 loc) · 813 Bytes
/
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
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
*/
import React, {useState} from 'react';
import {SafeAreaView, Button} from 'react-native';
import {Colors} from 'react-native/Libraries/NewAppScreen';
import Greeting from './components/Greeting';
import Box from './components/Box';
function App(): React.JSX.Element {
const name = 'JinHa Park';
const [visible, setVisible] = useState(true) as [boolean, Function];
const onButtonPress = () => setVisible(!visible);
return (
<>
<SafeAreaView style={Colors.light}>
{visible && <Box rounded={true} size="small" color="pink" />}
<Button title={visible ? 'Hide' : 'Show'} onPress={onButtonPress} />
<Greeting name={name} />
</SafeAreaView>
</>
);
}
export default App;