React-native 报错PropsType的错误

解决办法

//下载prop-types包 npm install prop-types

在代码中引入

import PropTypes from 'prop-types';

现在是使用验证器不要加前面React

//15.5 以前 Greeting.propTypes = { name: React.PropTypes.string }; //15.5 及以后 不要加React Greeting.propTypes = { name: PropTypes.string };

猜你喜欢

转载自blog.csdn.net/qq_25905161/article/details/81298542