Avatar of Dinesh Bali
Dinesh Bali asked on

Cannot read properties of undefined (reading 'props')


In my react app. I am getting below error from the following code.

This code is taken from:


import React from "react";
import { Map, InfoWindow, Marker, GoogleApiWrapper } from 'google-maps-react';

const Googlemap = () => {
        return (
                <Map google={this.props.google} zoom={14}>
                        <Marker onClick={this.onMarkerClick}
                                name={'Current location'} />
                        <InfoWindow onClose={this.onInfoWindowClose}>

export default GoogleApiWrapper({
        apiKey: ("My key")

Open in new window


Please advise.

Kind Regards,

ReactProgramming Languages-OtherHTMLWeb DevelopmentScripting Languages

Avatar of undefined
Last Comment
Scott Fell

8/22/2022 - Mon
Scott Fell

I have not dove into react very much, but I will try and help.

From your example, I found the original here GitHub - fullstackreact/google-maps-react: Companion code to the "How to Write a Google Maps React Component" Tutorial 

What I think I am seeing in your error is 'props' is not defined.

Do you have code that defines that?

Also, is your google api key activated?  and set for your ip? That will also throw an error, but that will be a different error I believe. 
Dinesh Bali

Thanks for your reply.
I am not sure what props I should pass.
Key is activated.
Used the same code as in example given at url:

Please advise.

Scott Fell

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck