TanStack / query

🤖 Powerful asynchronous state management, server-state utilities and data fetching for the web. TS/JS, React Query, Solid Query, Svelte Query and Vue Query.
https://tanstack.com/query
MIT License
40.09k stars 2.69k forks source link

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

Open bitcrumb opened 4 weeks ago

bitcrumb commented 4 weeks ago

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.

vercel[bot] commented 4 weeks ago

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

1 Ignored Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **query** | ⬜️ Ignored ([Inspect](https://vercel.com/tanstack/query/3ZQEbP1jav3UKRPfsfvuC8wMdSgn)) | [Visit Preview](https://query-git-fork-bitcrumb-patch-2-tanstack.vercel.app) | | Apr 19, 2024 7:17am |
codesandbox-ci[bot] commented 4 weeks ago

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.

TkDodo commented 3 weeks ago

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: