Answers for "error typeerror: undefined is not an object (evaluating '_ref.navigation')"

4

typeerror undefined is not an object (evaluating 'navigation.navigate')

import { useNavigation } from '@react-navigation/native';

function NotificationsScreen() {
const navigation = useNavigation(); 
return(
<Button
        onPress={() => navigation.navigate('Notifications')}
        title="Go to notifications"
      />
);
}
Posted by: Guest on November-22-2020
2

ERROR TypeError: undefined is not an object (evaluating 'route.key')

I had the same problem, and it was the @react-navigation/native and 
@react-navigation/stack versions installed. Make sure that the 2 libraries have
the same version in the package.json file.
Posted by: Guest on August-23-2021

Code answers related to "error typeerror: undefined is not an object (evaluating '_ref.navigation')"

Code answers related to "Javascript"

Browse Popular Code Answers by Language