我使用了react-native- background -geolocation插件来进行后台gps跟踪,但我经常收到这样的错误消息:"Can't find variable: Actions“
尽管我得到了正确的位置对象
我使用了以下代码
BackgroundGeolocation.on('location', (location) => {
//handle your locations here
console.log(JSON.stringify(location));
Actions.sendLocation(location);
});如果有人曾经遇到过这个问题,或者知道如何解决这个问题,那将对我非常有帮助!
发布于 2016-12-14 00:37:19
操作是包的一部分,因此您必须导入它,例如
import { Actions } from 'react-native-router-flux';https://stackoverflow.com/questions/41119388
复制相似问题