Skip to content

Add guard around mapDom event listener - #594

Merged
itsmichaeldiego merged 1 commit into
GoogleMapReact:masterfrom
bignimbus:master
May 31, 2018
Merged

itsmichaeldiego merged 1 commit into
GoogleMapReact:masterfrom
bignimbus:master

Conversation

@bignimbus

Copy link
Copy Markdown
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

itsmichaeldiego commented May 31, 2018 •

Copy link
Copy Markdown
Member

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 GoogleMapReact:master May 31, 2018
@lock

lock Bot commented Dec 1, 2019

Copy link
Copy Markdown

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