Rapsssito / react-native-tcp-socket

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

Incorrect typing for socket.address()? #93

Closed ericleb010 closed 3 years ago

ericleb010 commented 3 years ago

Description

Typing for TcpSocket.address() seems to be different from what the library returns at runtime.

Steps to reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Or code:

// Your code

Current behavior

Calling TcpSocket.address() returns an object that resembles: {family: 'IPv4', port: 54014, address: '192.168.200.143'}

Expected behavior

According to the type definitions, TcpSocket.address() should just be a string: '192.168.200.143'

Screenshots If applicable, add screenshots to help explain your problem.

Relevant information

OS ?
react-native ?
react-native-tcp-socket ?
Rapsssito commented 3 years ago

@ericleb010, you are right! Thanks for the feedback, working on a fix.

github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version 5.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: