react-use
react-use copied to clipboard
useGeolocation shows infinity loading after update to React 18 (only locally)
For some reason after I updated my project to React 18 and react-use to 17.4, while developing process (on localhost), I have always {loading: true}
property. With both options (allowed/disabled)
Not sure why your bug only happens in React 18, but this might help:
In almost all browsers the Geolocation API is only available in secure contexts (i.e., over https). Try running your project through ngrok locally and check the https address.
@LobodaAndreyEK any reproduce demo?
React strict mode has to be off for this to work.
React strict mode has to be off for this to work.
Do you know why this is? Spent forever debugging this issue before I found this thread.
https://reactjs.org/docs/strict-mode.html - might give a better understanding