React native setting/accessing a variable inside a function
问题 I'm trying to set the variables lat and lng to the coordinates returned by the geocoder. I think that lat and lng are accessible from inside the geocoder code where it says Geocoder.getFromLocation(inputWhere).then(...), but then outside of that, it doesn't seem to have set the variables to the geocoder's coordinates. Am I missing something about the variable scope? I've commented what the alerts are returning. I've tested that the geocoder works fine and that the "if" condition is being