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