环境:
操作系统:Linux5.3节点: 12.16.1 Yarn: 1.21.1 npm: 6.13.4守望者: 4.9.0 Xcode: N/A Android Studio: 3.5 AI-191.8026.42.35.5791312
Packages: (wanted => installed)
react: ^16.3.0-alpha.0 => 16.13.0
react-native: 0.55.0 => 0.55.0"dependencies": {
"prop-types": "^15.7.2",
"react": "^16.3.0-alpha.0",
"react-native": "0.55.0",
"react-native-parabolic": "~1.1.1",
"react-native-scrollable-tab-view": "~0.7.1",
"react-native-swiper": "~1.5.4",
"react-native-tab-navigator": "~0.3.3"
}export default class DefaultTabBar extends Component{
constructor(){
super()
}
static propTypes = {
goToPage: PropTypes.func,
activeTab: PropTypes.number,
tabs: PropTypes.array,
backgroundColor: PropTypes.string,
activeTextColor: PropTypes.string,
inactiveTextColor: PropTypes.string,
textStyle: Text.propTypes.style,
tabStyle: View.propTypes.style,
renderTab: PropTypes.func,
underlineStyle: View.propTypes.style,
};imgae:https://imgur.com/KBwsscf
我怎么才能修好它?
发布于 2020-03-11 13:52:01
您可以使用这个:
import PropTypes from 'prop-types';
class Greeting extends React.Component {
render() {
return (
<h1>Hello, {this.props.name}</h1>
);
}
}
Greeting.propTypes = {
name: PropTypes.string
};发布于 2020-03-11 11:20:44
你的问题不清楚。但我认为这是你的问题:
View.propTypes 反对.
->改为使用ViewPropTypes。
import { ViewPropTypes } from 'react-native';
...
underlineStyle: ViewPropTypes.style,https://stackoverflow.com/questions/60633462
复制相似问题