React v16.3.0 fixes.

This commit is contained in:
orangemug 2018-05-17 11:24:39 +01:00
parent 79b251d8b9
commit 77da0a6d30
8 changed files with 9 additions and 9 deletions

View file

@ -37,7 +37,7 @@ export default class ZoomProperty extends React.Component {
}
}
componentWillMount() {
componentDidMount() {
this.setState({
refs: this.setStopRefs(this.props)
})
@ -66,7 +66,7 @@ export default class ZoomProperty extends React.Component {
return newRefs;
}
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
const newRefs = this.setStopRefs(nextProps);
if(newRefs) {
this.setState({

View file

@ -17,7 +17,7 @@ class NumberInput extends React.Component {
}
}
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
this.setState({ value: nextProps.value })
}

View file

@ -18,7 +18,7 @@ class StringInput extends React.Component {
}
}
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
this.setState({ value: nextProps.value || '' })
}

View file

@ -29,7 +29,7 @@ class JSONEditor extends React.Component {
}
}
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
this.setState({
code: JSON.stringify(nextProps.layer, null, 2)
})

View file

@ -69,7 +69,7 @@ export default class LayerEditor extends React.Component {
this.state = { editorGroups }
}
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
const additionalGroups = { ...this.state.editorGroups }
layout[nextProps.layer.type].groups.forEach(group => {

View file

@ -79,7 +79,7 @@ export default class MapboxGlMap extends React.Component {
}
}
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if(!this.state.map) return
const metadata = nextProps.mapStyle.metadata || {}
MapboxGl.accessToken = metadata['maputnik:mapbox_access_token'] || tokens.mapbox

View file

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

View file

@ -31,7 +31,7 @@ class Gist extends React.Component {
}
}
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
this.setState({
...this.state,
preview: !!(nextProps.mapStyle.metadata || {})['maputnik:openmaptiles_access_token']