I got an error with latest tab navigator and react native 0.16:
My code:
var TabBar = Platform.OS === 'ios'?React.TabBarIOS:require('react-native-tab-navigator');
var TabNavigator = React.createClass({
getInitialState: function() {
return {
selectedIndex: 0,
};
},
_isCurrentTab:function(index){
//console.log(""+this.state.selectedIndex+"==="+index);
return this.state.selectedIndex===index;
},
render: function() {
//... tabs is just a array of <TabBar.Item/>
return (
<TabBar style={{backgroundColor:'black'}}>
{tabs}
</TabBar>
);
},
});
Nothing special . I think.
After some hours for searching reason. I found a work around:
in 'TabNavigator.js' , remove export default and use module.exports = TabNavigator; to export the module .
I'm a js newbie , not sure it's a js or react native problem , or just related to this module.
I got an error with latest tab navigator and react native 0.16:
My code:
Nothing special . I think. After some hours for searching reason. I found a work around:
in 'TabNavigator.js' , remove
export default
and usemodule.exports = TabNavigator;
to export the module . I'm a js newbie , not sure it's a js or react native problem , or just related to this module.