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
Create NetworkUtills.js
import NetInfo from "@react-native-community/netinfo";
export default class NetworkUtils {
static async isNetworkAvailable() {
const response = await NetInfo.fetch();
return response.isConnected;
}}
Use anywhere like this
const isConnected = await NetworkUtils.isNetworkAvailable()