Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

104
Views
Google Maps InfoWindow does not render when map is clicked (React.js)

Just a short disclaimer before I move to the actual question. I am working on someone else’s React project and am supposed to improve it any way I can. They have added a Google map and markers to their web app, which I am not very familiar with.

So here goes the question. I have discovered the following bug. When the map is clicked, a pop-up (InfoWindow) is supposed to appear containing a form that the user can fill in. Once submitted, the data is saved on a database and when the same marker is clicked again, the data that was submitted is rendered inside the InfoWindow. No matter how many forms are submitted, the user can add more markers and repeat the same process. However, if a marker's InfoWindow is closed without the form being filled in and submitted, new infoWindows (containing a form) do not display anymore when the map is being clicked.

I have gone through the code multiple times, but cannot understand where the problem lies.

{newMarker && (
          <MarkerF
            position={{
              lat: newMarker.latitude,
              lng: newMarker.longitude,
            }}
            icon={{
              url: require('../.././assets/firemarker.png'),
            }}
          >
            {/* Pop-up bug must be here */}
            {/* create new marker by clicking on map */}
            <InfoWindowF
              position={{
                lat: newMarker.latitude,
                lng: newMarker.longitude,
              }}
            >
              <div>
                <Form 
                  handleFormSubmit={handleFormSubmit}
                  setUserLocation={setUserLocation}
                  setUserDescription={setUserDescription}
                  setFirePower={setFirePower}
                />
              </div>
            </InfoWindowF>
          </MarkerF>
        )}
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.6.3/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.6.3/umd/react-dom.production.min.js"></script>

almost 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!