I am getting geocode locations into the latt,lngg variables through axios and setState , i want to use this variables inside google-map-react package center How can i pass these state values into props .
Rest API
then(res => {
console.log(res.data.results[0].geometry.location.lat);
console.log(res.data.results[0].geometry.location.lng);
// console.log(res.data[0]);
this.setState({latt:res.data.results[0].geometry.location.lat})
this.setState({lngg:res.data.results[0].geometry.location.lng})
})
static defaultProps = {
center: {
lat: 32,
lng: 56
},
zoom: 5.7
};
<GoogleMapReact bootstrapURLKeys={{ key:API-KEY}} defaultCenter={this.props.center} defaultZoom={this.props.zoom}>