Rapsssito / react-native-tcp-socket

React Native TCP socket API for Android, iOS & macOS with SSL/TLS support.
MIT License
304 stars 80 forks source link

undefine is not a object (evaluating '_reactNative.TcpSocket.createConnection') #125

Closed ShikharY10 closed 2 years ago

ShikharY10 commented 2 years ago

I'm getting this error when I try to use this module with react native on android

Or code:

import {
  Text,
  View,
  ImageBackground,
  Pressable,
  TcpSocket,
} from "react-native";

function connectToServer() {
  console.log("Connecting");
  const client = TcpSocket.createConnection(() => {
    console.log("Working");
  });
}

I'm new to react native and that's why I'm not able to understanding the problem clearly, need help..

Relevant information

OS android 6
react-native 0.63.2
react-native-tcp-socket ^5.3.0