Fix errors uncovered by v0.19.0

Reviewed By: mroch

Differential Revision: D2706663

fb-gh-sync-id: 017c91bab849bf18767cacd2ebe32d1a1b10c715
This commit is contained in:
Gabe Levi
2015-12-01 19:09:01 -08:00
committed by facebook-github-bot-9
parent d4d41f9523
commit 892dd5b86a
24 changed files with 168 additions and 41 deletions

View File

@@ -49,11 +49,15 @@ var GeolocationExample = React.createClass({
componentDidMount: function() {
navigator.geolocation.getCurrentPosition(
(initialPosition) => this.setState({initialPosition}),
(position) => {
var initialPosition = JSON.stringify(position);
this.setState({initialPosition});
},
(error) => alert(error.message),
{enableHighAccuracy: true, timeout: 20000, maximumAge: 1000}
);
this.watchID = navigator.geolocation.watchPosition((lastPosition) => {
this.watchID = navigator.geolocation.watchPosition((position) => {
var lastPosition = JSON.stringify(position);
this.setState({lastPosition});
});
},
@@ -67,11 +71,11 @@ var GeolocationExample = React.createClass({
<View>
<Text>
<Text style={styles.title}>Initial position: </Text>
{JSON.stringify(this.state.initialPosition)}
{this.state.initialPosition}
</Text>
<Text>
<Text style={styles.title}>Current position: </Text>
{JSON.stringify(this.state.lastPosition)}
{this.state.lastPosition}
</Text>
</View>
);