mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
* Update viewstate on property changes * Compare props via isEqual
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
*/
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { isEqual } from 'lodash';
|
||||
import { StaticMap } from 'react-map-gl';
|
||||
import DeckGL from 'deck.gl';
|
||||
import { styled } from '@superset-ui/core';
|
||||
@@ -63,6 +64,12 @@ export class DeckGLContainer extends React.Component {
|
||||
};
|
||||
}
|
||||
|
||||
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||
if (!isEqual(nextProps.viewport, this.props.viewport)) {
|
||||
this.setState({ viewState: nextProps.viewport });
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
clearInterval(this.state.timer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user