Skip to content

Commit

Permalink
Compare props via isEqual
Browse files Browse the repository at this point in the history
  • Loading branch information
hbruch committed Jan 4, 2022
1 parent e3d7fbc commit dbbfec7
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -64,7 +65,7 @@ export class DeckGLContainer extends React.Component {
}

UNSAFE_componentWillReceiveProps(nextProps) {
if (nextProps.viewport !== this.props.viewport) {
if (!isEqual(nextProps.viewport, this.props.viewport)) {
this.setState({ viewState: nextProps.viewport });
}
}
Expand Down

0 comments on commit dbbfec7

Please sign in to comment.