42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
import * as React from 'react';
|
|
import { Button, View, Text } from 'react-native';
|
|
import { NavigationContainer } from '@react-navigation/native';
|
|
import { createStackNavigator } from '@react-navigation/stack';
|
|
import RNBootSplash from 'react-native-bootsplash';
|
|
RNBootSplash.hide();
|
|
|
|
function HomeScreen({ navigation }) {
|
|
return (
|
|
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
|
|
<Text>Home Screen</Text>
|
|
<Button
|
|
title="Go to Details"
|
|
onPress={() => navigation.navigate('Details')}
|
|
/>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function DetailsScreen() {
|
|
return (
|
|
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
|
|
<Text>Details Screen</Text>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
const Stack = createStackNavigator();
|
|
|
|
function App() {
|
|
return (
|
|
<NavigationContainer>
|
|
<Stack.Navigator>
|
|
<Stack.Screen name="Home" component={HomeScreen} options={{ title: 'Overview' }} />
|
|
<Stack.Screen name="Details" component={DetailsScreen} />
|
|
</Stack.Navigator>
|
|
</NavigationContainer>
|
|
);
|
|
}
|
|
|
|
export default App;
|