-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js.1
55 lines (49 loc) · 1.81 KB
/
App.js.1
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
import * as React from 'react';
import {Text, View, Button, TouchableOpacity} from 'react-native';
import HomeScreen from './src/screens/HomeScreen';
import ComponentsScreen from './src/screens/ComponentsScreen';
import ListScreen from './src/screens/ListScreen';
import {NavigationContainer} from '@react-navigation/native';
import {createStackNavigator} from '@react-navigation/stack';
export default function App() {
const Stack = createStackNavigator();
return (
<>
<View style={{flex: 1}}>
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="Home"
component={HomeScreen}
options={{title: 'Welcome'}}
/>
<Stack.Screen name="Profile" component={ListScreen}/>
</Stack.Navigator>
</NavigationContainer>
</View>
<View
style={{
flex: 1,
padding: 30,
textAlign: 'center',
backgroundColor: 'lightgray',
}}>
<Button title="button 1" onPress={() => console.log('pressed!')}/>
<TouchableOpacity onPress={() => console.log('pressed 2 ')}>
<Text>HOME</Text>
</TouchableOpacity>
<HomeScreen/>
<ComponentsScreen header="Header" subheader="Subheader"/>
</View>
<View
style={{
flex: 1,
padding: 30,
textAlign: 'center',
backgroundColor: 'wheat',
}}>
<ListScreen/>
</View>
</>
);
}