Skip to content

Commit

Permalink
Merge pull request #1218 from dnlkoch/unset-map-target
Browse files Browse the repository at this point in the history
Unset the map's target on unmount
  • Loading branch information
dnlkoch committed Aug 8, 2019
2 parents 61765b3 + 6da567e commit b2651f1
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions src/Map/MapComponent/MapComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,32 @@ export class MapComponent extends PureComponent {

/**
* Create a MapComponent.
*
* @constructs Map
*/
constructor(props) {
super(props);
}

/**
* The componentDidMount function
*
* @method componentDidMount
* The componentDidMount function.
*/
componentDidMount() {
this.props.map.setTarget(this.props.mapDivId);
const {
map,
mapDivId
} = this.props;

map.setTarget(mapDivId);
}

/**
* The componentWillUnmount function.
*/
componentWillUnmount() {
const {
map
} = this.props;

map.setTarget(null);
}

/**
Expand Down

0 comments on commit b2651f1

Please sign in to comment.