Skip to content

added if statement in onRemove() function#555

Merged
itsmichaeldiego merged 1 commit intogoogle-map-react:masterfrom
atkallie:master
Apr 17, 2018
Merged

added if statement in onRemove() function#555
itsmichaeldiego merged 1 commit intogoogle-map-react:masterfrom
atkallie:master

Conversation

@atkallie
Copy link
Contributor

@atkallie atkallie commented Apr 7, 2018

Added an if statement in onRemove() function that checks if this.div is defined before calling ReactDOM.unmountComponentAtNode(this.div). This is done to avoid throwing an unmountComponentAtNode(...): Target container is not a DOM element error. I ran into this error while using google-map-react with React Router and switching between tabs rapidly to stress test my application.

Added an if statement in onRemove() function that checks if "this.div" is defined before calling ReactDOM.unmountComponentAtNode(this.div). This is done to avoid throwing an "unmountComponentAtNode(...): Target container is not a DOM element" error. I ran into this error while using google-map-react with React Router and switching between tabs rapidly to stress test my application.
@itsmichaeldiego
Copy link
Member

@atkallie Thanks, defensive programming is always a plus.

@itsmichaeldiego itsmichaeldiego merged commit 147997c into google-map-react:master Apr 17, 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

Comments