expo / ex-navigation

Route-centric navigation for React Native
997 stars 201 forks source link

User taps on a tab - what tab index is it ? #469

Closed ajonno closed 7 years ago

ajonno commented 7 years ago

This feels like a dumb question but I couldn't figure it out - all I want to know is when a user taps on a given tab (eg. we have 4 tabs) we know which tab (by index) they just tapped. That's it.

Appreciate anyone's help with this hopefully quick/easy.

ajonno commented 7 years ago

its ok i got it. this is all i needed on a TabItem

     onPress={(tabItemOnPress) => {
           tabItemOnPress();
     }}