title: react-navigation: How to change tabBar color based on current tab
body: <p>I'm getting started with react-navigation.<br>
  How do I change the tabBar background color when I change tab?</p>
  
  <p>Here is some <em>pseudo-code</em> showing what I'm hoping for:</p>
  
  <pre><code>_backgroundColor = function() { 
      switch (this.routeName) {
        case 'tabHome':     return { backgroundColor: '#002663' };
        case 'tabRewards':  return { backgroundColor: '#3F9C35' };
        default:            return { backgroundColor: 'white' }           
      }
  }
  
  // Tabs setup
  export const TabStack = TabNavigator({
    tabHome:     { screen: HomeStack,       },
    tabRewards:  { screen: RewardsStack,    },
  }, {
    tabBarOptions: {
      style: _backgroundColor(),
    }
  });
  </code></pre>
  
  <p>At the minute it's always defaulting to white ( which is fine because my code is wrong :-)   so how do I pass in <em>something</em> which triggers this logic either on routeName or iconLabel or whatever.</p>
  
  <p>Any help would be most appreciated.<br>
  Thanks in advance.<br>
  Cheers</p>