Skip to content

Add guard around mapDom event listener #594

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

Merged
merged 1 commit into from
May 31, 2018

Conversation

bignimbus
Copy link
Contributor

Fixes an issue where, even if the end user has a proper google maps API
mock, the GoogleMaps component will throw an error when in a test
env. ReactDOM.findDOMNode(this.googleMapDom_) returns null.

This commit wraps the subsequent addEventListener call in an if block,
ensuring that an empty DOM doesn't add complications to test suites

Thank you for your consideration and your hard work on this great library!

Fixes an issue where, even if the end user has a proper google maps API
mock, the GoogleMaps component will throw an error when in a test
env.  ReactDOM.findDOMNode(this.googleMapDom_) returns `null`.

This commit wraps the subsequent addEventListener call in an `if` block,
ensuring that an empty DOM doesn't add complications to test suites
@itsmichaeldiego
Copy link
Member

itsmichaeldiego commented May 31, 2018

This is great @bignimbus ! Thanks, someone opened a similar PR but provided not as good description as yours. Merging and it will be present in the next release together with other group of changes as this one is not a blocker.

Thanks again @bignimbus

@itsmichaeldiego itsmichaeldiego merged commit 99c3c84 into google-map-react:master May 31, 2018
@lock
Copy link

lock bot commented Dec 1, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants