justinpark commented on code in PR #21650:
URL: https://github.com/apache/superset/pull/21650#discussion_r988337179
##########
superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx:
##########
@@ -102,22 +96,24 @@ const collapseStyles = (theme: SupersetTheme) => css`
}
`;
-export default function SqlEditorLeftBar({
- actions,
+const SqlEditorLeftBar = ({
database,
- queryEditor,
+ queryEditorId,
tables = [],
height = 500,
setEmptyState,
-}: SqlEditorLeftBarProps) {
+}: SqlEditorLeftBarProps) => {
+ const dispatch = useDispatch();
+ const queryEditor = useQueryEditor(queryEditorId, ['schema']);
+
// Ref needed to avoid infinite rerenders on handlers
// that require and modify the queryEditor
- const queryEditorRef = useRef<QueryEditor>(queryEditor);
+ const queryEditorRef = useRef(queryEditor);
Review Comment:
`queryEditorRef` won't be no longer needed. Please use queryEditor (from
line 107) instead.
Please remove the following block around line 135.
```
useEffect(() => {
queryEditorRef.current = queryEditor;
}, [queryEditor, database]);```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]