I am using react-native-camera and when I open it I cant go back with the hardware button, so I decided to create a button EXIT so when user clicks on it should go back to the previous view. The problem is that I am only using one class! so how can I navigate to the same class but different view?
Here is the way I tried:
import { createStackNavigator, createAppContainer } from "react-navigation";
<View style={styles.barcode_bottomOverlay}>
<TouchableOpacity onPress={() => this.props.navigation.navigate('ThisPage', { data })}>
<Text>Exit</Text>
</TouchableOpacity>