Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native: No propType for native prop RCTView.maxHeight

After upgrading to RN 0.30 I started seeing the error shown below even when building the simplest possible app:

react-native init AwesomeProject
react-native run-ios
  • The strangest is that components BlurView, VibrancyView and RNSearchBar are included in the warning messages despite the project not using them.
  • Recompiling/cleaning the project doesn't fix the problem.

Console & error:

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.

screenshot

like image 888
Peter G. Avatar asked Jul 22 '16 06:07

Peter G.


4 Answers

The reason for this error was that another instance of React packager (still on 0.28) was running in the background at the time after I updated to 0.30.

Restarting React packager solved the problem.

like image 51
Peter G. Avatar answered Oct 19 '22 09:10

Peter G.


I restarted the react native by react-native start and it solved my issue.

like image 25
Neha Prakash Avatar answered Oct 19 '22 11:10

Neha Prakash


I was getting this same error message, although in my case it was caused by incompatibilities between dependencies.

What I did to solve it was:

  1. Create a new project using create-react-native-app foo. This should install compatible dependencies.
  2. Open your project's package.json and update the versions of the dependencies to match those in foo's package.json.
  3. Check that expo version match the sdkVersion in the file app.json and update if necessary.
  4. Delete node_modules and reinstall all the packages.

I hope it helps!

like image 3
Daniel Reina Avatar answered Oct 19 '22 10:10

Daniel Reina


In my case react-server and react-project were mismatched. I was running the wrong project with the wrong Node server.

like image 2
Hitesh Sahu Avatar answered Oct 19 '22 10:10

Hitesh Sahu