kgabryje commented on a change in pull request #11240:
URL: 
https://github.com/apache/incubator-superset/pull/11240#discussion_r506218790



##########
File path: superset-frontend/src/components/TableLoader.jsx
##########
@@ -68,43 +69,36 @@ class TableLoader extends React.PureComponent {
       addInfoToast,
       addSuccessToast,
       addWarningToast,
+      columns,
       ...tableProps
     } = this.props;
 
-    let { columns } = this.props;
-    if (!columns && this.state.data.length > 0) {
-      columns = Object.keys(this.state.data[0]).filter(col => col[0] !== '_');
-    }
+    const memoizedColumns = memoize((columns, data) => {

Review comment:
       Converted to functional. `useMemo` for the win




----------------------------------------------------------------
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:
[email protected]



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

Reply via email to