mirror of
https://github.com/google-map-react/google-map-react.git
synced 2025-12-08 18:26:32 +00:00
added if statement in onRemove() function (#555)
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.
This commit is contained in:
parent
9d0b3939ba
commit
147997c5f7
@ -610,7 +610,7 @@ export default class GoogleMap extends Component {
|
||||
},
|
||||
|
||||
onRemove() {
|
||||
ReactDOM.unmountComponentAtNode(this.div);
|
||||
if(this.div) ReactDOM.unmountComponentAtNode(this.div);
|
||||
},
|
||||
|
||||
draw() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user