Camera expo blocked when used in a stacknavigator nested in a tabnavigator

#1

Assuming the following route configuration (using react-navigation library) :

export const AddTrucsNav = StackNavigator(
  {
    Camera: { screen: CameraScreen }, // => wrap an expo Camera Component
    ConfirmPhoto: { screen: ConfirmPhotoScreen },
    InputTitlePhoto: { screen: InputTitlePhotoScreen },
    InputTitleEmoji: { screen: InputTitleEmojiScreen },
    InputEmoji: { screen: InputEmojiScreen }
  },
  {
    headerMode: "none"
  }
);


export default TabNavigator(
  {
    AddTrucsNav: { screen: AddTrucsNav },
    ViewTrucsNav: { screen: ListeTrucsScreen }
  },
  {
    tabBarComponent: ({ navigation }) => (
      <NavigationBar navigation={navigation} />
    ),
    swipeEnabled: true,
    animationEnabled: true,
    headerMode: "none"
  }
);

I am positioned in one the of the following screens :

  • ConfirmPhoto: { screen: ConfirmPhotoScreen },
    
  • InputTitlePhoto: { screen: InputTitlePhotoScreen },
    
  • InputTitleEmoji: { screen: InputTitleEmojiScreen },
    
  • InputEmoji: { screen: InputEmojiScreen }
    

If I try a this.props.navigation.navigate("Camera"), I go back to the CameraScreen but Camera expo is blocked and the functional prop onMountError is triggered.

I find a workaround by using a this.props.navigation.goBack(screen-key), but I am not sure it is a nice solution. Maybe have you got a better solution ?

Anyway is there a solution to reload the camera in the case of a onMountError ?

Thanks