query icon indicating copy to clipboard operation
query copied to clipboard

Use `isInternetReachable` instead of `isConnected` in the online manager example

Open bitcrumb opened this issue 1 year ago • 3 comments

The isConnected property actually only conveys that the network connection has been established (e.g. Wi-Fi connection), which not necessarily implies that there is a working internet connection.

So I as wondering if it is not better to use isInternetReachable instead? Although I am aware (and thus a bit hesitant as well) that the netinfo library implements this through a HEAD request to a Google URL.

bitcrumb avatar Apr 19 '24 07:04 bitcrumb

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
query ⬜️ Ignored (Inspect) Visit Preview Apr 19, 2024 7:17am

vercel[bot] avatar Apr 19 '24 07:04 vercel[bot]

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

codesandbox-ci[bot] avatar Apr 19 '24 07:04 codesandbox-ci[bot]

I guess it depends on what you want. I don't know react native much and this guide was contributed by someone else. If you say isInternetReachable is better, we can change it. There are some open issues about it though:

  • https://github.com/react-native-netinfo/react-native-netinfo/issues/615
  • https://github.com/react-native-netinfo/react-native-netinfo/issues/572

TkDodo avatar Apr 21 '24 08:04 TkDodo

closing as stale

TkDodo avatar Sep 15 '24 19:09 TkDodo