geo-react react component to make it easier to work with geolocation see https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API You should use a comprehensive package like react-use