Skip to content

Commit ca8d736

Browse files
committed
Update Console.js
1 parent d18ffc3 commit ca8d736

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/app/Console.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ const Console = observer(({ run }) => {
2020
return scrollIsAtBottom;
2121
};
2222

23-
scrollConsoleToBottom = () => {
24-
const { scrollHeight, clientHeight } = this.stdoutContainer;
23+
const scrollConsoleToBottom = useCallback(() => {
24+
if (!stdoutContainerRef.current) return;
25+
const { scrollHeight, clientHeight } = stdoutContainerRef.current;
2526
const diff = scrollHeight - clientHeight;
26-
this.stdoutContainer.scrollTop = diff;
27-
};
27+
stdoutContainerRef.current.scrollTop = diff;
28+
}, []);
2829

2930
return (
3031
<Box

0 commit comments

Comments
 (0)