Sending `geolocationDidChange` with no listeners

 Sending `geolocationDidChange` with no listeners registered

我在使用react-native的时候,出现了如下警告,请问该怎么解决?在网上搜索过,但是没有一样的问题,请问该怎么办?

我不知道是监听什么东西?这个是在当我使用了Geolocation组件的时候,就会出现这个问题
reac-native版本是0.51.0,按照你的说法应该就是去监听geolocationDidChange方法吗?但是这个方法也不是我写的,是系统底层处理的

,最后我对于定位的实现采用如下方式完美解决: https://blog.csdn.net/suwu150/article/details/80935563

事件监听?


import {  DeviceEventEmitter } from 'react-native'

componentDidMount() {
        //收到监听
        this.listener = DeviceEventEmitter.addListener('通知名称', (e)=>{
                alert(e)
        });
}
componentWillUnmount(){
        // 移除监听 
        this.listener.remove();
}

B页面


DeviceEventEmitter.emit('通知名称',value);  // 发监听

建议使用react-native-baidu-map 来获取定位 如何使用请参照 https://www.jianshu.com/p/fd8f24eb5b5c