title: Nativebase Tabs not changing content when changing page value
body: <p>I am having problems with navigating to a tab from another screen. When I am on the page clicking the tabs, the content switches fine, but when I try to set the active tab from another component before navigating to that screen, I am having issues with going to the specified tab. </p>
  
  <p>I've tried passing parameters through the navigation to the parent screen like this: <code>this.props.navigation.navigate('Menu', {goToOrderDetails: true})</code> and then inside the Menu screen, I made a <code>componentFocused</code> function where every time the page is in focus, I am checking if that <code>goToOrderDetails</code> parameter is true, and if it is, I am manually setting the state variable that is being used to set the active tab. This, however, is not working and just returns directly to the default tab (0), however, the styling color indicators are on the correct tab, but the content is that of the first tab.</p>
  
  <p>This is how I am currently trying to do it: 
  Here is the Menu screen: </p>
  
  <pre class="lang-js prettyprint-override"><code>import React, {Component} from 'react';
  import {observer} from "mobx-react";
  import {ScrollView} from 'react-native';
  import {Container, Tab, Tabs, ScrollableTab} from 'native-base';
  import OrderHistory from './OrderHistory';
  import Favorites from '../components/Favorites';
  import Heading from '../components/Heading';
  import store from '../store/store';
  import i18n from 'i18n-js';
  
  class Menu extends Component {
      constructor() {
          super();
          this.subs;
          this.state = {
              activeTab: 0, 
              initialPage: 0
          };
      }
  
       getTab() {
          if(this.props.navigation.state.params){
              if(this.props.navigation.state.params.page == 'orderhistory') {
                  return 2;
              }if(this.props.page == 'favorites'){
                  return 1;
              }else{
                  return 0;
              }
          } else {
              if (this.props.navigation.getParam('orderHistory') || store.toOrderHistory == true) {
                  return 2;
              } else if (this.props.navigation.getParam('favorites')) {
                  return 1;
              }
              store.toOrderHistory.set(false);
          }
      }
  
      componentDidMount() {
          this._componentFocused();
          this._sub = this.props.navigation.addListener(
              'didFocus',
              this._componentFocused
          );
      }
  
      _componentFocused = () =&gt; {
          store.updateActiveTab(this.getTab());
      }
  
      updateTab(tab) {
          store.updateActiveTab(tab.i);
      }
  
      render() {
          return (
              &lt;Container&gt;
                  &lt;Heading title={'Menu'} /&gt;
                      &lt;Tabs onChangeTab={(tab) =&gt; {this.updateTab.bind(this, tab)}} 
                            page={store.activeTab.get()} 
                            renderTabBar={()=&gt; &lt;ScrollableTab /&gt;}&gt; 
                          &lt;Tab heading={i18n.t('menu.all_tab')}&gt;
                              &lt;ScrollView&gt;
                                  {this.displayMenu()}
                              &lt;/ScrollView&gt;
                          &lt;/Tab&gt;
                          &lt;Tab heading={i18n.t('menu.fav_tab')}&gt;
                              &lt;Favorites&gt;&lt;/Favorites&gt;
                          &lt;/Tab&gt;
                          &lt;Tab heading={i18n.t('menu.recent_tab')}&gt;
                              &lt;OrderHistory&gt;&lt;/OrderHistory&gt;
                          &lt;/Tab&gt;
                      &lt;/Tabs&gt;
              &lt;/Container&gt;
          )
      };
  }
  
  export default observer(Menu);
  
  </code></pre>
  
  <p>And I am trying to send the navigation parameter from the order details screen to this screen like this: <code>this.props.navigation.navigate('Menu',{goToOrderDetails: true})</code> and when that parameter is true, I am updating the store activeTab value like this: <code>store.updateActiveTab.set(2)</code>. 
  The strangest part is that if I console.log the tab value, it is 2! Which is the correct one I need it to be on! And as I mentioned earlier, the color of the title is also the active color! It is just the content and the color underline that are not on that tab. 
  Is it possible that it is necessary to refresh the entire tabs component so that I can change the active tab from another screen? I am not sure why this behavior is occurring and could use some help!</p>
  
  <p>Here is a screenshot of what happens after I have manually changed the active tab from the order details component! 
  <a href="https://i.stack.imgur.com/tFMpJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tFMpJ.png" alt="The content is that of the menu and the menu and bolded &lt;code&gt;Recent&lt;/code&gt; is page that should be showing active!"></a></p>