title: How to make “Go back to initial Screen when a BottomTabNavigator's is pressed”
body: <p>when i click an a bottom navigation tab i want the screen to go Back to the initial screen of that bottom tab for exemple when i navigate to RouteToProfile then i press  search(BottomTabNavigator) and goes back to home i still
  find the screen of the RouteToprofile
  ps : i'm using react navigation 3.0.0 </p>
  
  <pre><code>  -Home
        |
         mainScreen  
         Subrouts 
        RouteToProfile 
        ....
  
    -Search 
          |
           mainScreen
           another page
            ....
  </code></pre>
  
  <pre><code>import React from "react";
  
  import Ionicons from "react-native-vector-icons/Ionicons";
  
  import {
    createStackNavigator,
    createBottomTabNavigator,
    createAppContainer
  } from "react-navigation";
  
  import HomeScreen from "./HomeScreen";
  import SettingsScreen from "./SettingsScreen";
  import DetailsScreen from "./DetailsScreen";
  import ProfileScreen from "./ProfileScreen";
  import NotificationsScreen from "./NotificationsScreen";
  import Page from "./Page";
  import SearchScreen from "./SearchScreen";
  import RdvConfirmation from "./RdvConfirmation";
  import ProfileDoctor from "./ProfileDoctor";
  import Choisirdate from "./Choisirdate";
  import Choisirtime from "./Choisirtime";
  
  const HomeStack = createStackNavigator(
    {
      Home: { screen: HomeScreen },
      Details: { screen: DetailsScreen },
      Page: { screen: Page }
    },
    {
      defaultNavigationOptions: {
        headerStyle: {
          backgroundColor: "#42f44b"
        },
        headerTintColor: "#FFFFFF",
        title: "Home"
        //Header title
      }
    }
  );
  const SearchStack = createStackNavigator(
    {
      //Defination of Navigaton from home screen
      search: { screen: SearchScreen },
      ProfileDoctor: { screen: ProfileDoctor },
      Choisirdate: { screen: Choisirdate },
      Choisirtime: { screen: Choisirtime },
      RdvConfirmation: { screen: RdvConfirmation }
    },
    {
      defaultNavigationOptions: {
        headerStyle: {
          backgroundColor: "#42f44b"
        },
        headerTintColor: "#FFFFFF",
        title: "Search"
      }
    }
  );
  
  const NotificationsStack = createStackNavigator(
    {
      Notifications: { screen: NotificationsScreen }
      //  ,MesRDv: { screen: page }
    },
    {
      defaultNavigationOptions: {
        headerStyle: {
          backgroundColor: "#42f44b"
        },
        headerTintColor: "#FFFFFF",
        title: "Notifications"
        //Header title
      }
    }
  );
  const SettingsStack = createStackNavigator(
    {
      //Defination of Navigaton from setting screen
      Settings: { screen: SettingsScreen },
      Details: { screen: DetailsScreen },
      Profile: { screen: ProfileScreen }
    },
    {
      defaultNavigationOptions: {
        headerStyle: {
          backgroundColor: "#42f44b"
        },
        headerTintColor: "#FFFFFF",
        title: "Settings"
        //Header title
      }
    },
    {
      initialRouteName: SearchScreen
    }
  );
  const App = createBottomTabNavigator(
    {
      Home: { screen: HomeStack },
      search: { screen: SearchStack },
      Notifications: { screen: NotificationsStack },
      Settings: { screen: SettingsStack }
    },
    {
      defaultNavigationOptions: ({ navigation }) =&gt; ({
        tabBarIcon: ({ focused, horizontal, tintColor }) =&gt; {
          const { routeName } = navigation.state;
          let IconComponent = Ionicons;
          let iconName;
          if (routeName === "Home") {
            iconName = `ios-medkit${focused ? "" : "-outline"}`;
          } else if (routeName === "Settings") {
            iconName = `ios-settings${focused ? "" : "-outline"}`;
          } else if (routeName === "Notifications") {
            iconName = `ios-notifications${focused ? "" : "-outline"}`;
          } else if (routeName === "search") {
            iconName = `ios-search${focused ? "" : "-outline"}`;
          }
  
          return &lt;IconComponent name={iconName} size={25} color={tintColor} /&gt;;
        }
      }),
      tabBarOptions: {
        activeTintColor: "#42f44b",
        inactiveTintColor: "gray"
      }
    }
  );
  export default createAppContainer(App);
  </code></pre>