我已经使用 react-native-background-geolocation 插件进行后台 gps 跟踪,但我经常收到此错误“找不到变量:操作”
虽然我得到了正确的位置对象
我使用了下面的代码
BackgroundGeolocation.on('location', (location) => {
//handle your locations here
console.log(JSON.stringify(location));
Actions.sendLocation(location);
});
如果有人曾经遇到过这个问题或知道如何解决,那对我会很有帮助!!
最佳答案
Actions 是一个包的一部分,所以你必须导入它 例如
import { Actions } from 'react-native-router-flux';
关于javascript - react native : Can't find variable: Actions,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41119388/