Removed componentWillUpdate

This commit is contained in:
orangemug
2018-08-06 22:24:13 +01:00
parent c5ea9494df
commit 1aa90bef37
7 changed files with 52 additions and 48 deletions

View File

@@ -29,10 +29,10 @@ class OpenLayers3Map extends React.Component {
const styleFunc = olms.apply(this.map, newMapStyle)
}
UNSAFE_componentWillReceiveProps(nextProps) {
componentDidUpdate() {
require.ensure(["ol", "ol-mapbox-style"], () => {
if(!this.map) return
this.updateStyle(nextProps.mapStyle)
this.updateStyle(this.props.mapStyle)
})
}