We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d18ffc3 commit ca8d736Copy full SHA for ca8d736
1 file changed
src/app/Console.js
@@ -20,11 +20,12 @@ const Console = observer(({ run }) => {
20
return scrollIsAtBottom;
21
};
22
23
- scrollConsoleToBottom = () => {
24
- const { scrollHeight, clientHeight } = this.stdoutContainer;
+ const scrollConsoleToBottom = useCallback(() => {
+ if (!stdoutContainerRef.current) return;
25
+ const { scrollHeight, clientHeight } = stdoutContainerRef.current;
26
const diff = scrollHeight - clientHeight;
- this.stdoutContainer.scrollTop = diff;
27
- };
+ stdoutContainerRef.current.scrollTop = diff;
28
+ }, []);
29
30
return (
31
<Box
0 commit comments