michael-s-molina commented on code in PR #23871:
URL: https://github.com/apache/superset/pull/23871#discussion_r1181544067
##########
superset-frontend/src/SqlLab/components/SqlEditor/index.jsx:
##########
@@ -354,39 +355,28 @@ const SqlEditor = ({
return base;
}, [dispatch, queryEditor.sql, startQuery, stopQuery]);
- const handleWindowResize = useCallback(() => {
+ const handleWindowResize = useEffectEvent(() => {
setHeight(getSqlEditorHeight());
Review Comment:
```suggestion
setHeight(height);
```
##########
superset-frontend/src/SqlLab/components/SqlEditor/index.jsx:
##########
@@ -354,39 +355,28 @@ const SqlEditor = ({
return base;
}, [dispatch, queryEditor.sql, startQuery, stopQuery]);
- const handleWindowResize = useCallback(() => {
+ const handleWindowResize = useEffectEvent(() => {
Review Comment:
You should pass the `height` to the effect event. Check the **Notes**
[here](https://react.dev/learn/separating-events-from-effects).
```suggestion
const handleWindowResize = useEffectEvent(height => {
```
--
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]