ptomasroos / react-native-tab-navigator

A tab bar that switches between scenes, written in JS for cross-platform support
MIT License
2.4k stars 416 forks source link

Warning: Failed prop type: TabNavigator: prop type `tabBarStyle` is invalid; #200

Open semnyqu opened 4 years ago

semnyqu commented 4 years ago

import TabNavigator from 'react-native-tab-navigator';

render() { return ( <TabNavigator tabBarStyle={{height: 49}}> {......} ); }

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.

307499815 commented 4 years ago

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 };

Yonina11-code commented 4 years ago

ViewPropTypes

ViewPropTypes is undefined

BadtzMaru commented 3 years ago

I'm just deleting this code tabBarStyle: TabBar.propTypes.style in TabNavigator.js . It's the fastest method to solve the error.

ProCheng commented 3 years ago

大佬们这个问题怎么搞呀

hopetomorrow2019 commented 3 years ago

上面有了解决文案了。。删了它

situyuchai commented 3 years ago

Why not fix the bug