I have a React Native application and I\'m seeking to add functionality that checks if there is an active internet connection when the app first starts up, and continuously ther
I ran into this today and found solution which I believe is the best. Its gonna continuously search for network changes and display them accordingly.
I tested it with expo install @react-native-community/netinfo and its working flawlessly.
import {useNetInfo} from "@react-native-community/netinfo";
const YourComponent = () => {
const netInfo = useNetInfo();
return (
Type: {netInfo.type}
Is Connected? {netInfo.isConnected.toString()}
);
};