I am trying to have GoogleMapGazi access the props of my class GoogleMaps using the 'props=> ' but I cannot do it. I have passed the lat and lng props to the class by the parent component. Here's my code, any help will be great!
const GoogleMapGazi = withGoogleMap(props => (
<GoogleMap
defaultCenter={{ lat: 25.804281, lng: -80.1903893 }}
defaultZoom={15}
>
<Marker position={{ lat: props.lat, lng: props.lng }} />
</GoogleMap>
));
class GoogleMaps extends Component {
render() {
return (
<div>
<GoogleMapGazi
containerElement={<div style={{ height: `500px`, width: "600px" }} />}
mapElement={<div style={{ height: `100%` }} />}
/>
</div>
);
}
}
export default GoogleMaps;
latandlngprops to theGoogleMapGazicomponent in theGoogleMapsparent component.props.lat?GoogleMapGazidoesn't have the proplatandlngdefined, why would you expect them to be magically defined in yourGoogleMapGazi?