mirror of
https://github.com/visgl/react-map-gl.git
synced 2026-01-18 15:54:22 +00:00
React 16.9.0 deprecated lifecycles (#861)
This commit is contained in:
parent
e7fa38fc16
commit
7aa7dff0b6
@ -93,7 +93,7 @@ export default class Example extends Component {
|
||||
autobind(this);
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
UNSAFE_componentWillMount() {
|
||||
const colors = ['red', 'green', 'blue'];
|
||||
let i = 0;
|
||||
window.setInterval(
|
||||
|
||||
@ -32,7 +32,7 @@ export default class App extends Component {
|
||||
};
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
UNSAFE_componentWillMount() {
|
||||
window.onresize = () =>
|
||||
this.setState({
|
||||
viewport: {
|
||||
|
||||
@ -80,7 +80,7 @@ export default class StyleDiffingExample extends Component {
|
||||
this._onClick = this._onClick.bind(this);
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
UNSAFE_componentWillMount() {
|
||||
const colors = ['red', 'green', 'blue'];
|
||||
let i = 0;
|
||||
this._intervalId = window.setInterval(
|
||||
|
||||
@ -245,7 +245,7 @@ export default class InteractiveMap extends PureComponent<InteractiveMapProps, S
|
||||
this._updateInteractiveContext({mapContainer});
|
||||
}
|
||||
|
||||
componentWillUpdate(nextProps: InteractiveMapProps, nextState: State) {
|
||||
UNSAFE_componentWillUpdate(nextProps: InteractiveMapProps, nextState: State) {
|
||||
this._setControllerProps(nextProps);
|
||||
|
||||
if (nextState.isDragging !== this.state.isDragging) {
|
||||
|
||||
@ -8,7 +8,7 @@ import '../stylesheets/main.scss';
|
||||
|
||||
class App extends Component {
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||
if (this.props.location !== nextProps.location) {
|
||||
this.props.setHeaderOpacity(1);
|
||||
this.props.toggleMenu(false);
|
||||
|
||||
@ -89,7 +89,7 @@ export default class MarkdownPage extends PureComponent {
|
||||
this._jumpTo(this.props.query.section);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||
if (nextProps.content !== this.props.content) {
|
||||
this.setState({
|
||||
html: renderMarkdown(nextProps.content)
|
||||
|
||||
@ -14,7 +14,7 @@ class Page extends Component {
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||
const {route} = nextProps;
|
||||
if (this.props.route !== route) {
|
||||
this.setState({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user