Nativebase: [ANDROID] onPress Event for Tabs

Created on 25 Oct 2017  路  8Comments  路  Source: GeekyAnts/NativeBase

react-native, react and native-base version

native-base: "^2.3.1",
react: "16.0.0-alpha.12",
react-native : "0.47.1",

Expected behaviour

How do call a function when Native base Tab Component is clicked / pressed.

Actual behaviour

onPress event not working in Tab component

Steps to reproduce (code snippet or screenshot)

<Container>
   <Tabs style={{}} tabBarPosition="bottom" >
          <Tab style={{}} heading='Network' onPress={() => console.log("tab1")}>
          </Tab>
          <Tab style={{}} heading='Jobs' onPress={() => console.log("tab2")}>
          </Tab>
    </Tabs>
</Container>

Screenshot of emulator/device

Is the bug present in both ios and android or in any one of them?

maybe a feature needed for ANDROID

Any other additional info which would help us debug the issue quicker.

Most helpful comment

All 8 comments

@Naveen-ICARUS you can use onChangeTab prop of <Tabs/> which can be used to detect a change in tab selection

@akhil-geekyants Thank you so much. Its what I needed.

I'll Close this issue

How can i know which tab is actived ?

@Naveen-ICARUS you can use onChangeTab prop of which can be used to detect a change in tab selection

Would be great if this prop would be documented in the API reference, instead of needing to search Github for an answer.

How can i disable or enable a particular tab ?

Also i have the same question , how i can disable a specific tab ?

I want to change tabs to next and back by pressing button, how can I do that?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

natashache picture natashache  路  3Comments

agersoncgps picture agersoncgps  路  3Comments

georgemickael-b picture georgemickael-b  路  3Comments

maphongba008 picture maphongba008  路  3Comments

aloifolia picture aloifolia  路  3Comments