title: how to logout from react navigation stacknavigation nested components
body: <p>i want to logout from a component inside a stacknavigator and the stacknavigator is inside a bottomtabsnavigator which is finally inside a stacknavigator that houses two switchnavigator </p>
  
  <p>i tried this.props.navigation.navigate(component) and it failed and several other ways i am a bit stuck and frustrated any help will be greatly appreciated as i am new to react native and react navigation</p>
  
  <pre><code>const AddContactTab = createStackNavigator({
      AddContact: AddContactsActivity,
  });
  const ManageContactsTab = createStackNavigator({
      ManageContacts: ManageContactsActivity,
      viewContact: ViewSingleContactsActivity,
      editContacts: EditContactsActivity
  });
  
  
  
  const Tabs = createBottomTabNavigator({
      ManageContacts: ManageContactsTab,
      AddContact: AddContactTab
  }, {
      tabBarOptions: {
           activeBackgroundColor:'#3F51B5',
          activeTintColor:'#ccc',
          showLabel:false,
          style: {
              backgroundColor:'white',
              color:'white'
            },
            tabStyle:{
            },
  
          //   labelStyle:{
          //     color:'white',
          //     fontWeight: 'bolder',
          //     fontSize: 14
          //   }
      },
      defaultNavigationOptions: ({ navigation }) =&gt; ({
          tabBarIcon: () =&gt; {
              const { routeName } = navigation.state;
              let tabName;
              tabName = routeName === 'AddContact' ? 'plus' : 'home';
  
              return  &lt;Icon name={tabName} size={24} 
  
                color="grey" /&gt;
  
  
          }
      })
  },
  
  );
  export default createAppContainer(Tabs);
  
  
  
  
  
  const MainStack = createStackNavigator(
    {
      Home: { screen: HomeActivity },
      Register: {screen: RegistrationActivity}
    },
    {
        initialRouteName: 'Home',
    }
    );
  
  
  
  
    const AuthStack = createStackNavigator(
      {
        Dashboard: { screen: DashboardActivity },
      },
      {
          initialRouteName: 'Dashboard',
      }
      ); 
  
  
      const RootStack = createSwitchNavigator({
        initialLoading: InitialLoadingActivity,
        auth: AuthStack,
        all: MainStack,
      }, 
      {
        initialRouteName: 'initialLoading',
    });
  </code></pre>
  
  <p>now i want to logout from addcontactsactivity to the initialroute of the AuthStack stack navigator....please if i am not clear enough let me know so i can edit my question</p>