-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
useIsConnected returns null initially in 6+ #377
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
any update regarding this issue? or any workaround? but if i turn on internet again….nothing happens at all. after turning off internet once… it doesn’t update anymore. |
Hi! same issue here. We should be able to control the initial value of the hook, otherwise it is forcing us to add another function to determine what value "null" should be. |
I have just realized that it returns null only first time it is called. So if in your initial screen you just wait until the value is different than null then all is ok :) |
Is there any way to change the "definition" of isConnected? I want it to be more similar to netInfo's where it doesn't necessarily need internet access, so i can avoid pinging entirely. |
Current Behavior
useIsConnected
will return null prior to the first "check". This breaks a lot of assumptions that I had from 5.X since it defaulted to true previously.false
Expected Behavior
I expect the typing foruseIsConnected
to reflect what it will returnHow to reproduce
Your Environment
The text was updated successfully, but these errors were encountered: