You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/01/12 23:41:33 UTC

[GitHub] [superset] eschutho commented on a change in pull request #12472: fix (SQL Lab): disappearing results on tab switch

eschutho commented on a change in pull request #12472:
URL: https://github.com/apache/superset/pull/12472#discussion_r556168899



##########
File path: superset-frontend/src/SqlLab/components/SouthPane.jsx
##########
@@ -90,20 +90,11 @@ export class SouthPane extends React.PureComponent {
       height: props.height,
     };
     this.southPaneRef = React.createRef();
-    this.getSouthPaneHeight = this.getSouthPaneHeight.bind(this);
     this.switchTab = this.switchTab.bind(this);
   }
 
-  UNSAFE_componentWillReceiveProps() {
-    // south pane expands the entire height of the tab content on mount
-    this.setState({ height: this.getSouthPaneHeight() });
-  }
-
-  // One layer of abstraction for easy spying in unit tests
-  getSouthPaneHeight() {
-    return this.southPaneRef.current
-      ? this.southPaneRef.current.clientHeight
-      : 0;
+  UNSAFE_componentWillReceiveProps(props) {
+    this.setState({ height: props.height });

Review comment:
       since state is just a representation of props at this point, can we remove the state and just use the props?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org