Skip to content

Instantly share code, notes, and snippets.

@dblazeski
Last active February 7, 2019 12:10
Show Gist options
  • Select an option

  • Save dblazeski/e7677db0d209c03713b24fcf00443c0e to your computer and use it in GitHub Desktop.

Select an option

Save dblazeski/e7677db0d209c03713b24fcf00443c0e to your computer and use it in GitHub Desktop.
Register our local function linked to defaultNavigationOptions - tapOnTabNavigator
// for registering the caller "tapOnTabNavigator"
// see https://gist.github.com/dblazeski/1e86142e0a8548bcde9b78c71846b3f9
export default class SearchScreen extends React.Component {
componentDidMount() {
// Register our local function called by
// tabBarOnPress() in defaultNavigationOptions()
this.props.navigation.setParams({
tapOnTabNavigator: this.tapOnTabNavigator
})
}
// Call on tab bar tap
tapOnTabNavigator = () => {
this.doSomethingTabWasPressed()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment