Skip to content

TabBarIcon can not call class as a funtion #2013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
colorfulberry opened this issue Jul 12, 2017 · 1 comment
Closed

TabBarIcon can not call class as a funtion #2013

colorfulberry opened this issue Jul 12, 2017 · 1 comment

Comments

@colorfulberry
Copy link

image
code

export default class TabIcon extends Component {
  constructor(props) {
    super(props)
    this.state = {
      TbIcon: '',
      TbIconActive: ''
    }
  }

  render(){
    return <Text
      style={{color: props.selected ? 'red' : 'black'}}
    >TAB
      {props.title}
    </Text>
  }

};

And if we will not support an class with TabIcon?

@aksonov
Copy link
Owner

aksonov commented Jul 12, 2017

Use stateless function instead. It seems requirement from ReactNavigation and I agree - icon should not maintain any state.

@aksonov aksonov closed this as completed Jul 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants