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

fix renderIcon logic to be optional and not trigger stylesheet warnings #77

Closed mikelambert closed 8 years ago

mikelambert commented 8 years ago

renderIcon is a weird mix of optional (TabNavigatorIcon has a default value, TabNavigator constantly checks item.props.renderIcon) and non-optional (marked as func.isRequired). On top of that, the default value of renderIcon returns a , which does not accept the defaultSelectedIcon stylesheet's tintColor (which is only allowed on elements.)

This correctly makes renderIcon optional again in all senses of the word, and ensures the code works without warnings in such cases. (I see some references on the issue tracker about this problem.)

This isn't important in shipping code (where you'll most likely have icons), but is important when first setting it up without icons and seeing scary looking warnings. The renderIcon is optional in many ways (has a default value that returns a

ide commented 8 years ago

Published in 0.3.2, thanks :)