我想在某些事件中动态更改值
事件:
BackgroundGeolocation.on('location', (location) => {
currentDistance = distance(previousLatitude,previousLongitude,latitude,longitude);
this.setState({
text: currentDistance
});
});
<Text>
Moving : {this.state.text}
</Text>
Run Code Online (Sandbox Code Playgroud)
有谁知道如何更改文本或任何其他方法来实现?
我正在使用react native开发应用程序,我需要删除特定的对象,这些对象在过滤方法中给了我,但这给了我一个错误
“只能删除事务中的对象。”
这是我的代码
allObj1 = {
id : 1,
speed : "1",
accuracy: "100",
bearing: "1",
longitude: "192",
altitude: "1111",
latitude: "1111",
time: "11111",
locationProvider: "2222",
};
allObj2 = {
id : 2,
speed : "1",
accuracy: "100",
bearing: "1",
longitude: "192",
altitude: "1111",
latitude: "1111",
time: "22222",
locationProvider: "2222",
};
allObj3 = {
id : 3,
speed : "1",
accuracy: "100",
bearing: "1",
longitude: "192",
altitude: "1111",
latitude: "1111",
time: "333333",
locationProvider: "2222",
};
realm.write(() => {
realm.create('Location',allObj1 …Run Code Online (Sandbox Code Playgroud)