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/11/07 14:18:52 UTC

[GitHub] [superset] michael-s-molina commented on a diff in pull request #21650: chore: Use queryEditorId in SqlEditor child components

michael-s-molina commented on code in PR #21650:
URL: https://github.com/apache/superset/pull/21650#discussion_r1015478034


##########
superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx:
##########
@@ -225,41 +213,45 @@ export default function SqlEditorLeftBar({
       }
     />
   );
-  const handleSchemaChange = useCallback(
-    (schema: string) => {
-      if (queryEditorRef.current) {
-        actions.queryEditorSetSchema(queryEditorRef.current, schema);
-      }
-    },
-    [actions],
-  );
 
-  const handleTablesLoad = React.useCallback(
-    (options: Array<any>) => {
-      if (queryEditorRef.current) {
-        actions.queryEditorSetTableOptions(queryEditorRef.current, options);
-      }
-    },
-    [actions],
-  );
+  const handleSchemaChange = useCallback((schema: string) => {
+    if (queryEditor) {
+      dispatch(queryEditorSetSchema(queryEditor, schema));
+    }
+  }, []);

Review Comment:
   Can you add the correct dependencies to `useCallback` functions?



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