ptomasroos / react-native-tab-navigator

A tab bar that switches between scenes, written in JS for cross-platform support
MIT License
2.4k stars 416 forks source link

Is there a way to check when route changes?? #121

Closed johhansantana closed 7 years ago

johhansantana commented 7 years ago

I am having a bit of trouble finding it.

I am hiding the tab bar at login screen but would like to show it (in pretty much every other screen) again after user navigates away from login screen.

If there's a way to check for current route every time the user navigates?

ptomasroos commented 7 years ago

If you make sure to set some state in the onPress function you can know which tab's active and I guess that's what you're referring as a route here. onPress will be activated when a user navigates on the tabs

    onPress={() => this.setState({ selectedTab: 'home' })}>