From 77da0a6d308061888ec87fd3700c9a0c7845202d Mon Sep 17 00:00:00 2001 From: orangemug Date: Thu, 17 May 2018 11:24:39 +0100 Subject: [PATCH] React v16.3.0 fixes. --- src/components/fields/_ZoomProperty.jsx | 4 ++-- src/components/inputs/NumberInput.jsx | 2 +- src/components/inputs/StringInput.jsx | 2 +- src/components/layers/JSONEditor.jsx | 2 +- src/components/layers/LayerEditor.jsx | 2 +- src/components/map/MapboxGlMap.jsx | 2 +- src/components/map/OpenLayers3Map.jsx | 2 +- src/components/modals/ExportModal.jsx | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/fields/_ZoomProperty.jsx b/src/components/fields/_ZoomProperty.jsx index 5659b14..bca99ad 100644 --- a/src/components/fields/_ZoomProperty.jsx +++ b/src/components/fields/_ZoomProperty.jsx @@ -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({ diff --git a/src/components/inputs/NumberInput.jsx b/src/components/inputs/NumberInput.jsx index c57af00..f4f3ebe 100644 --- a/src/components/inputs/NumberInput.jsx +++ b/src/components/inputs/NumberInput.jsx @@ -17,7 +17,7 @@ class NumberInput extends React.Component { } } - componentWillReceiveProps(nextProps) { + UNSAFE_componentWillReceiveProps(nextProps) { this.setState({ value: nextProps.value }) } diff --git a/src/components/inputs/StringInput.jsx b/src/components/inputs/StringInput.jsx index 6987b3c..54685fa 100644 --- a/src/components/inputs/StringInput.jsx +++ b/src/components/inputs/StringInput.jsx @@ -18,7 +18,7 @@ class StringInput extends React.Component { } } - componentWillReceiveProps(nextProps) { + UNSAFE_componentWillReceiveProps(nextProps) { this.setState({ value: nextProps.value || '' }) } diff --git a/src/components/layers/JSONEditor.jsx b/src/components/layers/JSONEditor.jsx index ca30c5b..8cec16d 100644 --- a/src/components/layers/JSONEditor.jsx +++ b/src/components/layers/JSONEditor.jsx @@ -29,7 +29,7 @@ class JSONEditor extends React.Component { } } - componentWillReceiveProps(nextProps) { + UNSAFE_componentWillReceiveProps(nextProps) { this.setState({ code: JSON.stringify(nextProps.layer, null, 2) }) diff --git a/src/components/layers/LayerEditor.jsx b/src/components/layers/LayerEditor.jsx index 15c22d9..d205640 100644 --- a/src/components/layers/LayerEditor.jsx +++ b/src/components/layers/LayerEditor.jsx @@ -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 => { diff --git a/src/components/map/MapboxGlMap.jsx b/src/components/map/MapboxGlMap.jsx index c65410e..b5ff174 100644 --- a/src/components/map/MapboxGlMap.jsx +++ b/src/components/map/MapboxGlMap.jsx @@ -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 diff --git a/src/components/map/OpenLayers3Map.jsx b/src/components/map/OpenLayers3Map.jsx index bb67432..113781a 100644 --- a/src/components/map/OpenLayers3Map.jsx +++ b/src/components/map/OpenLayers3Map.jsx @@ -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) diff --git a/src/components/modals/ExportModal.jsx b/src/components/modals/ExportModal.jsx index e75391d..c08a9c6 100644 --- a/src/components/modals/ExportModal.jsx +++ b/src/components/modals/ExportModal.jsx @@ -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']