react-native-tab-navigator icon indicating copy to clipboard operation
react-native-tab-navigator copied to clipboard

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

Open semnyqu opened this issue 4 years ago • 6 comments

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.

semnyqu avatar Apr 26 '20 06:04 semnyqu

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

307499815 avatar Sep 30 '20 05:09 307499815

ViewPropTypes

ViewPropTypes is undefined

Yonina11-code avatar Oct 18 '20 10:10 Yonina11-code

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

BadtzMaru avatar Dec 22 '20 07:12 BadtzMaru

大佬们这个问题怎么搞呀

ProCheng avatar Feb 07 '21 11:02 ProCheng

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

hopetomorrow2019 avatar Mar 22 '21 02:03 hopetomorrow2019

Why not fix the bug

situyuchai avatar Jul 14 '21 12:07 situyuchai