React Native:原生道具RCTView.maxHeight没有propType

Pet*_* G. 37 javascript ios npm reactjs react-native

升级到RN 0.30后,即使构建最简单的应用程序,我也开始看到如下所示的错误:

react-native init AwesomeProject
react-native run-ios
Run Code Online (Sandbox Code Playgroud)
  • 最奇怪的是,组件BlurView,VibrancyView以及RNSearchBar被列入尽管没有使用它们的项目的警告信息.
  • 重新编译/清理项目不能解决问题.

控制台和错误:

2016-07-22 08:48:02.985 [warn][tid:main][RCTEventEmitter.m:52] Sending `websocketFailed` with no listeners registered.
2016-07-22 08:48:03.031 [warn][tid:com.facebook.react.JavaScript] Warning: Native component for "BlurView" does not exist
2016-07-22 08:48:03.032 [warn][tid:com.facebook.react.JavaScript] Warning: Native component for "VibrancyView" does not exist
2016-07-22 08:48:03.033 [warn][tid:com.facebook.react.JavaScript] Warning: Native component for "RNSearchBar" does not exist
2016-07-22 08:48:03.040 [error][tid:com.facebook.react.JavaScript] `Constructor` has no propType for native prop `RCTView.maxHeight` of native type `CGFloat`
If you haven't changed this prop yourself, this usually means that your versions of the native code and JavaScript code are out of sync. Updating both should make this error go away.
2016-07-22 08:48:03.043 [fatal][tid:com.facebook.react.RCTExceptionsManagerQueue] Unhandled JS Exception: `Constructor` has no propType for native prop `RCTView.maxHeight` of native type `CGFloat`
If you haven't changed this prop yourself, this usually means that your versions of the native code and JavaScript code are out of sync. Updating both should make this error go away.
2016-07-22 08:48:03.102 [error][tid:com.facebook.react.JavaScript] Module AppRegistry is not a registered callable module.
2016-07-22 08:48:03.104 [fatal][tid:com.facebook.react.RCTExceptionsManagerQueue] Unhandled JS Exception: Module AppRegistry is not a registered callable module.
Run Code Online (Sandbox Code Playgroud)

截图

Pet*_* G. 89

出现此错误的原因是0.28我更新后的另一个React打包程序实例(仍然打开)在后台运行0.30.

重新启动React packager解决了这个问题.


小智 7

我通过react-native start重启了本地反应,它解决了我的问题.