-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Race Condition during event handlers initialization #136
Comments
I can see why it's happening, but I don't have a good Idea how to fix it properly.
So there could be a very short gap between creating the map instance / the |
Description
Due to how this library binds event handlers to the google maps object there is a race condition. Events might be fired before react event handler is attached to the map. The simplest example is
onProjectionChanged
:Steps to Reproduce
Try to reload map few times, and
onProjectionChanged
called not every time.This happened due to map instance created in one
useEffect
and events bound in another. They are executed in diffrent async cycles, so map sometimes managed to fire an event before handler attached.PS I tried to create a codesandbox with an issue, but in the sandbox no events were fired at all https://codesandbox.io/p/devbox/amazing-bohr-v65hqw
Environment
Logs
No response
The text was updated successfully, but these errors were encountered: