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 2022/01/11 15:19:24 UTC

[GitHub] [superset] AAfghahi commented on a change in pull request #17987: refactor: convert exploreresultsbutton from class component to functional component

AAfghahi commented on a change in pull request #17987:
URL: https://github.com/apache/superset/pull/17987#discussion_r782248631



##########
File path: superset-frontend/src/SqlLab/components/ExploreResultsButton/index.jsx
##########
@@ -40,16 +40,8 @@ const defaultProps = {
   query: {},
 };
 
-class ExploreResultsButton extends React.PureComponent {
-  constructor(props) {
-    super(props);
-    this.getInvalidColumns = this.getInvalidColumns.bind(this);
-    this.renderInvalidColumnMessage =
-      this.renderInvalidColumnMessage.bind(this);
-  }
-
-  getColumns() {
-    const { props } = this;
+function ExploreResultsButton(props) {

Review comment:
       All the others I completely agree with, but I think that this, being the functional component itself, does not need to be an arrow function. 
   
   However, I think that you need to destructure props here, you can do that by console logging the props and writing them out individually, its more explicit. 




-- 
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: notifications-unsubscribe@superset.apache.org

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