我的 Ionic 2 代码中的警告有点问题:
Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead.
我没有使用任何关于 React 或 proptypes 的东西,但我之前得到了消息描述。
我的包.json:
"dependencies": {
"@angular/common": "2.4.8",
"@angular/compiler": "2.4.8",
"@angular/compiler-cli": "2.4.8",
"@angular/core": "2.4.8",
"@angular/forms": "2.4.8",
"@angular/http": "2.4.8",
"@angular/platform-browser": "2.4.8",
"@angular/platform-browser-dynamic": "2.4.8",
"@angular/platform-server": "2.4.8",
"@auth0/cordova": "^0.1.0",
"@ionic-native/calendar": "^3.6.1",
"@ionic-native/camera": "^3.12.1",
"@ionic-native/core": "^3.10.3",
"@ionic-native/date-picker": "^3.10.3",
"@ionic/app-scripts": "0.0.38",
"@ionic/storage": "2.0.0",
"angular2-jwt": "0.1.27",
"auth0-js": "^7.4.0",
"auth0-lock": "10.13.0",
"chart.js": "^2.6.0",
"firebase": "^3.9.0",
"font-awesome": "^4.7.0",
"intl": "^1.2.5",
"ion2-calendar": "^1.0.7",
"ionic-angular": "2.2.0",
"ionic-native": "2.4.1",
"ionicons": "3.0.0",
"moment": "^2.18.1",
"ng2-pdf-viewer": "^1.1.0",
"rxjs": "5.0.1",
"sw-toolbox": "3.4.0",
"xml2js": "^0.4.17",
"zone.js": "0.7.2"
},
"devDependencies": {
"@ionic/app-scripts": "1.1.4",
"typescript": "2.0.9"
},
"cordovaPlugins": [
"cordova-plugin-device",
"cordova-plugin-console",
"cordova-plugin-whitelist",
"cordova-plugin-splashscreen",
"cordova-plugin-statusbar",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": [
"ios",
{
"platform": "ios",
"version": "",
"locator": "ios"
}
]
我已经逐行检查了我的代码,似乎没有什么调用 proptype 或反应。
我将不胜感激任何帮助。
此致敬意
我找到了哪个库与 React 有依赖关系,我们友好的"auth0-lock":"10.13.0"有它。解决方案:升级到版本 10.18.0,消息将永远消失。
感谢@YuryTarabanko的方法。
问候。
仅仅因为你没有使用PropType并不意味着你作为依赖项拉入的其他组件不是。并且还将为这些包显示警告。如果您想具体了解有关警告的详细信息,可以在此处阅读。