Closed Louventia closed 6 years ago
state = {
address: 'fetching',
}
componentDidMount() {
this.getAddressFromLatLong(atData.latitude, atData.longtitude);
}
getAddressFromLatLong(lat, long) {
Geocode.fromLatLng(lat, long).then(
response => {
this.setState({
address: response.results[0].formatted_address
})
},
error => {
this.setState({
address: error.message
})
}
);
}
render() {
return (
<td>{this.state.address}</td>
)
}
Hello! I'm very new to react and I am required to convert latitude to longitude which the latitude and longitude get from firebase. So the problem is that I am able to console log the address. However, I am not being able to display
This is the function that I wrote for the converting
This is where I render the address
Please advise >.<