Skip to content

Does not work for falsey values of name #58

@kanyuga

Description

@kanyuga

Since the selected value is calculated using (el.props.name || el.key) falsey values of el.props.name cause the current tab to not be identified properly e.g.

      <ScrollView>
        <Tabs
          style={{position: 'relative', top: 0}}
          selected={this.state.currentTab}
          onSelect={(el) => { this.switchTab(el.props.name) }}
          iconStyle={styles.tab}
          selectedIconStyle={styles.selectedTab}
          selectedStyle={styles.selectedTabText}
        >
          <Text name={0} style={styles.text}>Players</Text>
          <Text name={1} style={styles.text}>Log</Text>
        </Tabs>
        {this.props.children[this.state.currentTab]}
      </ScrollView>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions