diff --git a/src/google_map_markers.js b/src/google_map_markers.js index c0389249..88c06a21 100644 --- a/src/google_map_markers.js +++ b/src/google_map_markers.js @@ -96,10 +96,21 @@ export default class GoogleMapMarkers extends Component { this.dimensionsCache_ = {}; } - _getState = () => ({ - children: this.props.dispatcher.getChildren(), - updateCounter: this.props.dispatcher.getUpdateCounter(), - }); + _getState = () => { + let children = []; + let updateCounter = 0; + + if (this.props.dispatcher.getChildren) { + children = this.props.dispatcher.getChildren(); + } + if (this.props.dispatcher.getUpdateCounter) { + this.props.dispatcher.getUpdateCounter(); + } + return { + children, + updateCounter, + }; + }; _onChangeHandler = () => { if (!this.dimensionsCache_) {