🔨 ajout stack nav

pull/1/head
Maxence LANONE 2 years ago
parent 446bbbe0a8
commit 71a2709724

@ -9,13 +9,13 @@ const Stack = createStackNavigator();
export default function StackNavigator() {
return (
<NavigationContainer>
<Stack.Navigator
initialRouteName="Home"
initialRouteName="HomePage"
screenOptions={{ headerShown: false }}>
<Stack.Screen name="Home" component={HomePage} />
<Stack.Screen name="HomePage" component={HomePage} />
<Stack.Screen name="DetailCity" component={DetailCity} />
</Stack.Navigator>
</NavigationContainer>
)
}

@ -4,12 +4,12 @@ import { FlatList, Button, StyleSheet, Text, View, TextInput, Image } from 'reac
import { City, Weather, CITIES_DATA, FAVORITE_CITY_DATA, getCurrentWeather } from '../../data/stub';
import CityListItem from '../components/CityListItem';
export default function DetailCity() {
export default function DetailCity({route}) {
const weather = route.params.weather;
return (
<View style={styles.container}>
<Text>Test</Text>
<Text>{weather.temperature}</Text>
</View>
);

Loading…
Cancel
Save