Open piotr-cz opened 2 months ago
Describe the bug
The Geolocation error is still being returned from both useCurrentPosition and useWatchPosition hooks, even that the position has been read.
useCurrentPosition
useWatchPosition
To Reproduce
{ currentPosition: undefined, error: Error }
{ currentPosition: GeolocationPosition, error: Error }
Expected behavior Hooks should not return error when it does not happen
Desktop (please complete the following information):
Smartphone (please complete the following information): Not tested
Additional context Hooks should reset the error state on success:
const id = await Geolocation.watchPosition(options || {}, (pos: Position | null, err) => { - if (err) { - setError(err); - } + setError(err); if (pos) { setCurrentPosition(pos); } });
Describe the bug
The Geolocation error is still being returned from both
useCurrentPosition
anduseWatchPosition
hooks, even that the position has been read.To Reproduce
{ currentPosition: undefined, error: Error }
{ currentPosition: GeolocationPosition, error: Error }
Expected behavior Hooks should not return error when it does not happen
Screenshots
Desktop (please complete the following information):
Smartphone (please complete the following information): Not tested
Additional context Hooks should reset the error state on success: