has no propType for native prop.
If you haven't changed this prop yourself,this usually means that your versions of the native code andr JavaScript code are out of sync. Updating both should make this error go away.
解决办法就是在定义js组件属性时,加…View.propTypes
var VideoView = {
name:'VideoView',propTypes:{
style: View.propTypes.style,source:PropTypes.shape({
url:PropTypes.string,headers:PropTypes.object,}),...View.propTypes,//包含默认的View的属性,如果没有这句会报‘has no propType for native prop’错误
}
};
原文链接:https://www.f2er.com/react/305887.html