Skip to content
Snippets Groups Projects
Commit ae214a12 authored by isaacwsolomon's avatar isaacwsolomon
Browse files

Created details page and button to navigate to the page

parent a14c094d
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,9 @@ import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View } from 'react-native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { NavigationContainer } from '@react-navigation/native';
import List from './app/screens/list';
import Details from './app/screens/Details';
const Stack = createNativeStackNavigator();
......@@ -12,6 +14,7 @@ export default function App() {
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name="My Todos" component={List}/>
<Stack.Screen name="Details" component={Details}/>
</Stack.Navigator>
</NavigationContainer>
);
......
import { View, Text } from 'react-native'
import React from 'react'
const Details = () => {
return (
<View>
<Text>Details</Text>
</View>
)
}
export default Details
\ No newline at end of file
import React from 'react';
import { View, Text } from 'react-native';
import { View, Text, Button } from 'react-native';
const List = () => {
const List = ({navigation} : any) => {
return (
<View>
<Text>List</Text>
<Button onPress={() => navigation.navigate('Details')} title="Open Details"/>
</View>
);
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment