Use @react-native-community/netinfo to check if the device is connected to the internet. Display "Online" or "Offline" based on connectivity, and listen for changes.
Click Run to test your code