After clicking on go to about page:
CodePudding user response:
try importing the navigation from props as the following and retest:
export function Home({navigation}) {
return (
<View style={styles.container}>
<Text>Welcome!</Text>
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Home Screen</Text>
<Button
title="Go to About"
onPress={() => {
navigation.navigate('About')
}}
/>
</View>
</View>
);
}
And if this doesn't solve your problem or that's how you already have done it but didn't write all the code then please show all your code, as well as the About screen code