react-native-tab-navigator
react-native-tab-navigator copied to clipboard
Warning: Failed prop type: TabNavigator: prop type `tabBarStyle` is invalid;
import TabNavigator from 'react-native-tab-navigator';
render() { return ( <TabNavigator tabBarStyle={{height: 49}}> {......} </TabNavigator> ); }
Error:
Warning: Failed prop type: TabNavigator: prop type tabBarStyle
is invalid; it must be a function, usually from the prop-types
package, but received undefined
.
It's a bug. You need change the code as the following.
export default class TabNavigator extends React.Component { static propTypes = { ...ViewPropTypes, sceneStyle: ViewPropTypes.style, tabBarStyle: ViewPropTypes.style, tabBarShadowStyle: TabBar.propTypes.shadowStyle, hidesTabTouch: PropTypes.bool };
ViewPropTypes
ViewPropTypes is undefined
I'm just deleting this code tabBarStyle: TabBar.propTypes.style
in TabNavigator.js . It's the fastest method to solve the error.
大佬们这个问题怎么搞呀
上面有了解决文案了。。删了它
Why not fix the bug