-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Description
I ran into a bug (I think) with ReactOverlayView. Here's what I think is happening:
- MyReactComponent renders a Map component with overlays.
- Before the Google Maps JS can add the overlays to the Google Map,
MyReactComponent#setStatetriggers a re-render (because of Flux in my case). - React calls
ReactOverlayView#componentDidUpdate, which callsMapOverlayView#draw. (Note thatMapOverlayView#addhas still not been called.) MapOverlayView#getProjectionreturns undefined, so the following error appears:Uncaught TypeError: Cannot read property 'fromLatLngToDivPixel' of undefined
I think the fix is pretty simple -- have ReactOverlayView#componentDidUpdate check whether __node has a _containerElement before drawing (which means that onAdd has been called and drawing is 👍 ).
Pull request incoming, but feel free to push back if there's a better solution.
Metadata
Metadata
Assignees
Labels
No labels