Skip to content

Commit

Permalink
Unset the map's target on unmount
Browse files Browse the repository at this point in the history
  • Loading branch information
dnlkoch committed Aug 7, 2019
1 parent 61765b3 commit 6da567e
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 6da567e

Please sign in to comment.