我想在某个事件中动态更改值
活动:
BackgroundGeolocation.on('location', (location) => {
currentDistance = distance(previousLatitude,previousLongitude,latitude,longitude);
this.setState({
text: currentDistance
});
});
<Text>
Moving : {this.state.text}
</Text>
有人知道如何更改文本或任何其他方法来实现吗?