ptomasroos / react-native-tab-navigator

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

onPress method failure #71

Closed ghost closed 8 years ago

ghost commented 8 years ago

I had install react-native-tab-navigator and import it. When i run react-native run-ios or react-native run-android, it can display success. but click the item, didn't change the item color and the children view. Isn't it onpress failure? react-native and react evrsion are :

    "react": "^0.14.8",
    "react-native": "^0.25.1",

the component code :

      <TabNavigator.Item
        selected={this.state.selectedTab === tag}
        title={title}
        renderIcon={() => icon_normal}
        renderSelectedIcon={() => icon_onpress}
        selectedTitleStyle={styles.selectTitleStyle}
        renderBadge={()=>this._renderBadge(badgeCount)}
        onPress={() => this.setState({ selectedTab: tag })}>
        {childView}
      </TabNavigator.Item>

all props are useful, how can i to solve the problem?