Have som problems with calling the function to remove watchPositionAsync.
This is my code:
const getLocation = (position) => {
console.log(position);
}
const location = Location.watchPositionAsync({
enableHighAccuracy: true,
}, getLocation);
As i read the docs location
are returning a remove function, which i call like this:
location.remove();
But it is returning undefined.
Am I doing something wrong?
Anyone else having similar problem?
it's async, implement it asynchronously.
@fredjens @sonaye is correct. The correct code would be:
const location = await Location.watchPositionAsync({
enableHighAccuracy: true,
}, getLocation);
Thank you!
Most helpful comment
@fredjens @sonaye is correct. The correct code would be: