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/06/03 20:42:18 UTC

[GitHub] [superset] eschutho commented on a change in pull request #14830: refactor: Convert TableElement.jsx component from class to functional with hooks

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



##########
File path: superset-frontend/src/SqlLab/components/TableElement.jsx
##########
@@ -126,12 +108,11 @@ class TableElement extends React.PureComponent {
       );
     }
     return header;
-  }
+  };
 
-  renderControls() {
+  const renderControls = () => {
     let keyLink;
-    const { table } = this.props;
-    if (table.indexes && table.indexes.length > 0) {
+    if (table?.indexes.length > 0) {

Review comment:
       if (table?.indexes?.length)
   
   0 will be falsy, and it won't be negative. Also looks like indexes could be null or undefined. 




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