You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example i has one component <MyMap/>, which contains <GoogleMap/>. And now i need another component <PlaceFineder/> which uses google.maps.places.PlacesService which requires google.maps.Map object. So is there possibility to pass google.maps.Map from <MyMap/> component to <PlaceFineder/> component ? Something like:
If you need a reference of map object, You can try like this:
ref={googleMap => {
if (!googleMap) {
return ;
}
console.log(googleMap);
this.gmap = googleMap;
} }
this.gmap.props.map will give you the reference to map .
For example i has one component
<MyMap/>
, which contains<GoogleMap/>
. And now i need another component<PlaceFineder/>
which usesgoogle.maps.places.PlacesService
which requiresgoogle.maps.Map
object. So is there possibility to passgoogle.maps.Map
from<MyMap/>
component to<PlaceFineder/>
component ? Something like:this although should work, but not applicable in my case, is there another way ?
The text was updated successfully, but these errors were encountered: