Error: undefined is not an object (RCTWebSocketManager.connect \ evaluation)

I use React-native v0.10.0 and get this screen:

enter image description here

Well, I understand that I'm doing something wrong.

So, I downloaded the code from this official React-native site to integrate React-native into an existing application using pod .

The downloaded code uses React-native v0.2.1 , and everything looks good there. So I copied all the code and flipped mine, but the red screen still appears. It only left me with React-native changes

Is there a chance that the current version of React-native v0.10.1 does not work at all?: /

Thanks in advance!

+7
ios react-native
source share
3 answers

I had success by adding the pod 'React/RCTWebSocket' to the Podfile and running pod install again.

0
source share

This problem is caused by the fact that RCTWebSocketManager not listed in your application bundle. The connect method of an object cannot be called in an undefined or null object.

To fix this problem on iOS, open Build Phases for your target and make sure libRCTWebSocket.a exists in the Linking to Libraries section. If the item is not specified and cannot be added, add RCTWebSocket.xcodeproj to the Application Libraries folder in Xcode and try setting the link again.

0
source share

This may seem pretty trivial, but make sure you remove native-native from the node_modules directory in the response-native-router directory in the node_modules application directory. If response-native is displayed again, the application will throw an error.

I ran into this problem several times and this caused the error.

0
source share

All Articles