Closed adi-darachi closed 6 years ago
https://github.com/ReactTraining/react-network
the main code is window.navigator.onLine
Yes, navigator.onLine
and online
and offline
events on window
.
See example here: https://github.com/NekR/offline-plugin-pwa/blob/6a0e535514457f7c92e8b5d9f4ec2004e685bec1/src/main.js#L52-L69
It feels a bit obvious but I could not find it the documentation. I'm looking for a way to determine if the app is running in offline mode.
Thanks in advance!