bradcornford / Googlmapper

An easy way to integrate Google Maps with Laravel
MIT License
464 stars 143 forks source link

DrawingManager Displayed twice based on React-18 upgrade #384

Closed karamsetty09 closed 2 years ago

karamsetty09 commented 2 years ago

Upon upgrading our project to React-18:

Components using

are rendered twice and displaying two DrawingManager's(side by side). Mainly causing because setMap(map) adds DrawingManager for each render in React 18's cycle of -> mount -> unmount -> mount. setMap(map) Parameters: map: [Map](https://developers.google.com/maps/documentation/javascript/reference/map#Map) Return Value: None Attaches the DrawingManager object to the specified Map. Usual Behavior: Should show only one DrawingManager irrespective of render's Please let me know if its possible to display - DrawingManager can be limited to display only once.
karamsetty09 commented 2 years ago

wronge repo