How can I check if local network ip address is online ?

Hello everyone, I’m trying to check if a device with local ip address with the mobile app whether it is online or offline
I’ve done that before but, outside expo with react-native-tcp
is there any way to achieve that without ejecting from lovely expo ?