Answers for "react check internet connection"

1

react check internet connection

// Trigger sth, when Connection comes back | Connection gets lost
function poopityScoop(){
	window.ononline = (event) => {
    	console.log("Back Online")
	};
  
	window.onoffline = (event) => {
   		console.log("Connection Lost")
	};
}
Posted by: Guest on February-25-2021
0

react check internet connection

// check the current Connection State
   console.log(navigator.onLine)

// true - When internet connection is detected.
// false - When internet connection is not detected.
Posted by: Guest on February-25-2021

Code answers related to "react check internet connection"

Code answers related to "Javascript"

Browse Popular Code Answers by Language