私はいくつかのイベントに動的に値を変更したい
イベント:
BackgroundGeolocation.on('location', (location) => {
currentDistance = distance(previousLatitude,previousLongitude,latitude,longitude);
this.setState({
text: currentDistance
});
});
<Text>
Moving : {this.state.text}
</Text>
は、誰もがテキストまたは達成するための他の方法を変更する方法を知っているのですか?
を変更したいです正確に何を?どのようなイベントですか? – Tikkes
'this.setState({text: '別のテキスト'})' http://facebook.github.io/react-native/releases/0.38/docs/state.html – Cherniv
私の場所で計算する距離を更新したいイベント 質問が更新されました 未定義は関数ではありません(this.setState({text:currentDistance})を評価しています) –