go back react native navigation code example
Example 1: go back button react native
import * as React from 'react';
import { Button } from 'react-native';
import { useNavigation } from '@react-navigation/native';
function MyBackButton() {
const navigation = useNavigation();
return (
Example 2: go back react native navigation
onPress={() => { this.props.navigation.goBack()}}