0
我試圖實現這種反應機組件(react-native-geocoder)到我目前的應用程序,並出現以下錯誤:陣營母語:RNGeocoder.reverseGeocodeLocation - 可能未處理的承諾拒絕
[]([warn][tid:com.facebook.React.JavaScript] Possible Unhandled Promise
Rejection (id: 0):
undefined is not an object (evaluating 'RNGeocoder.reverseGeocodeLocation')
http://localhost:8081/index.ios.bundle?platform=ios&dev=true:61745:11
[email protected]://localhost:8081/index.ios.bundle?platform=ios&dev=true:2626:3
[email protected]://localhost:8081/index.ios.bundle?platform=ios&dev=true:2781:19
[email protected]://localhost:8081/index.ios.bundle?platform=ios&dev=true:2647:10
[email protected]://localhost:8081/index.ios.bundle?platform=ios&dev=true:61743:19
http://localhost:8081/index.ios.bundle?platform=ios&dev=true:15334:34
[email protected]://localhost:8081/index.ios.bundle?platform=ios&dev=true:76:17
[email protected]://localhost:8081/index.ios.bundle?platform=ios&dev=true:44:30
[email protected]://localhost:8081/index.ios.bundle?platform=ios&dev=true:36:19
global [email protected]://localhost:8081/index.ios.bundle?platform=ios&dev=true:61774:9
)
我的代碼
var RNGeocoder = require('react-native-geocoder');
// Reverse Geocoding
var NY = {
latitude: 40.7809261,
longitude: -73.9637594
};
RNGeocoder.reverseGeocodeLocation(NY, (err, data) => {
if (err) {
return;
}
console.log(data);
});
我的設置有任何設置問題嗎?我使用最新的反應原生版本。
非常感謝這是問題 – AppVault