Hello, I am trying to use useNavigation
to move between screens but I get an error in the DetailScreen
, I was looking for information about it and I think it is because in version 6 of react they made a change in the use of navigation.
import { useNavigation } from '@react-navigation/core' import React from 'react' import { Button, Text, View } from 'react-native'
export const HomeScreen = () => {
const navigation = useNavigation();
return (
<View>
<Text>Home Screen</Text>
<Button
title="ir detalle"
onPress={()=>navigation.navigate('DetailScreen')}
/>
</View>
)
}
Can someone help me by providing information about that, I was looking in the official documentation but I didn't find something clear. Thank you