React Native Don't Call PropTypes Warning

来源:互联网 发布:教师培训网络课程平台 编辑:程序博客网 时间:2024/05/01 11:47

在运行demo时出现大量: Warning: You are manually calling a React.PropTypes validation function for ...

在这个issue中找到了解决方法。

React 15.3.0中 对于 PropTypes有了变化 In a future major release of React, the code that implements PropType validation functions will be stripped in production.

然后demo中的React 版本设置的是 "react": "^15.2.1", 表示 15.2.1 <= version <= latest version,npm install时会去下载新版本, 把设置改成 "react": "~15.2.1" 就可以了,这表示15.2.1<= version< 15.3, 不会去下载15.3以上版本了。

0 0
原创粉丝点击