DEV Community 👩‍💻👨‍💻

Discussion on: Getting connected status on React Native

mutatedbread profile image
Ng Chen Hon Author


Forgive me for this very late reply.

I am presuming you are getting the error when running it on iOS.

I had not taken into consideration that any network requests on iOS must be https or have the url placed into exception when I was writing this.

Please try with the below if you are still stuck on this.

let req = await fetch('');
let hasConnection = req.status === 200;