rusackas commented on code in PR #26736:
URL: https://github.com/apache/superset/pull/26736#discussion_r2229143782


##########
superset-frontend/plugins/legacy-plugin-chart-map-box/src/MapBox.jsx:
##########
@@ -55,11 +59,35 @@ const defaultProps = {
   pointRadiusUnit: 'Pixels',
 };
 
-class MapBox extends Component {
-  constructor(props) {
-    super(props);
+const isEmpty = v => v === undefined || v === null || v === '';
 
-    const { width, height, bounds } = this.props;
+const MapBox = props => {
+  const {
+    width,
+    height,
+    bounds,
+    viewportLongitude,
+    viewportLatitude,
+    viewportZoom,
+    initialViewportSettings,
+    aggregatorName,
+    clusterer,
+    globalOpacity,
+    mapStyle,
+    mapboxApiKey,
+    pointRadius,
+    pointRadiusUnit,
+    renderWhileDragging,
+    rgb,
+    hasCustomMetric,
+    onViewportChange,
+  } = props;
+
+  const [viewport, setViewport] = React.useState();
+  // ++
+  const [clusters, setClusters] = React.useState();

Review Comment:
   ```suggestion
     const [clusters, setClusters] = useState();
   ```



##########
superset-frontend/plugins/legacy-plugin-chart-map-box/src/MapBox.jsx:
##########
@@ -55,11 +59,35 @@ const defaultProps = {
   pointRadiusUnit: 'Pixels',
 };
 
-class MapBox extends Component {
-  constructor(props) {
-    super(props);
+const isEmpty = v => v === undefined || v === null || v === '';
 
-    const { width, height, bounds } = this.props;
+const MapBox = props => {
+  const {
+    width,
+    height,
+    bounds,
+    viewportLongitude,
+    viewportLatitude,
+    viewportZoom,
+    initialViewportSettings,
+    aggregatorName,
+    clusterer,
+    globalOpacity,
+    mapStyle,
+    mapboxApiKey,
+    pointRadius,
+    pointRadiusUnit,
+    renderWhileDragging,
+    rgb,
+    hasCustomMetric,
+    onViewportChange,
+  } = props;
+
+  const [viewport, setViewport] = React.useState();

Review Comment:
   ```suggestion
     const [viewport, setViewport] = useState();
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to