I have the following function:
func = async () => {
let location = await getLocation();
console.log(location)
}
it calls this function
getLocation = async () => {
Geolocation.getCurrentPosition(
(position) => {
return 1
}
);
};
When I debug, I find that the code does indeed reach the return 1
line, but in func
it always sets location
to undefined
. Am I doing something wrong with the asynchronous call here?