Skip to content

Commit ba0794a

Browse files
committed
Move console scroll to useDidUpdate
1 parent f1b2cb5 commit ba0794a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

client/modules/IDE/components/Console.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ const Console = () => {
8787
}, [theme, fontSize]);
8888

8989
const cm = useRef({});
90-
const scrollConsoleDown = () => { cm.current.scrollTop = cm.current.scrollHeight; console.log('scroll'); };
91-
scrollConsoleDown();
90+
91+
useDidUpdate(() => { cm.current.scrollTop = cm.current.scrollHeight; });
9292

9393
const consoleClass = classNames({
9494
'preview-console': true,

0 commit comments

Comments
 (0)