title: ReactNative navigation 5 - how to obtain `navigation.state.params` (upgrade from 1.x)
body: <p>Trying to update old react navigation 1.x to current version 5.x.
  I need to display different tab icon depend on what value is in <code>navigation.state.params</code>, that were used in 1.x version. This value is set in one of the screen using navigation.dispatch(data).</p>
  
  <p>this is simplified code used with navigation 1.x:</p>
  
  <pre><code>import {TabBarBottom, TabNavigator} from 'react-navigation';
  import {MyIcon, AnotherIcon} from './icons.js';
  
  export default TabNavigator({
      Home: {screen: HomeRouter},
      Profile: {screen: ProfileRouter},
  }, {
      navigationOptions: ({navigation}) =&gt; ({
          tabBarIcon: ({focused}) =&gt; {
              const {routeName, params} = navigation.state;
              ...
              if (params.data === 1)  {
                  return &lt;AnotherIcon /&gt;
              }
              ...
              return &lt;MyIcon /&gt;;
          },
      }),
      tabBarComponent: TabBarBottom,
      tabBarPosition: 'bottom',
  });
  </code></pre>
  
  <p>how need to be change to work with React navigation v.5.x? or all I could do is to use React.Context?</p>