title: how to use tabBarOnPress in tabnavigator react native
body: <p>i am stuck in big problem that is i wants onPress event when i clicked on tab.
  my code is here:-</p>
  
  <pre><code>static navigationOptions = ({navigation, screenProps}) =&gt; {
     const params = navigation.state.params || {};
     console.log("Params:-",params);
    return {
          title:Strings.title_dashboard,
          headerStyle:{ backgroundColor: Colors.header_blue},
          headerTitleStyle:HeaderStyle.titleCenter,
          tabBarOnPress: (tab, jumpToIndex) =&gt; {
             console.log("Tab Click",tab);
              jumpToIndex(tab.index);
              navigation.state.params.onFocus()
          },
         headerRight:&lt;TouchableOpacity onPress={()=&gt;Alert.alert(Strings.avanza,Strings.under_imple)}&gt;&lt;View&gt;&lt;Image source={{uri: "filter_icon"}} style={{height: 18, width: 18,marginRight:10,}} /&gt;&lt;/View&gt;&lt;/TouchableOpacity&gt;,
    }
    }
  </code></pre>
  
  <p>at here i set the Params like this in componentDidMount:</p>
  
  <pre><code>this.props.navigation.setParams({
        handleGrid: this.callServer.bind(this)
      })
  </code></pre>
  
  <p>getting an error here not able to get this click event.</p>
  
  <p>Help me please.</p>
  
  <p>Thank you.</p>