From ba0794ab5ab2f1bcc2008a3e18117e4f41fbc808 Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Mon, 17 Aug 2020 15:55:34 -0400 Subject: [PATCH] Move console scroll to useDidUpdate --- client/modules/IDE/components/Console.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/modules/IDE/components/Console.jsx b/client/modules/IDE/components/Console.jsx index 9bf6abdf..ddb6d55e 100644 --- a/client/modules/IDE/components/Console.jsx +++ b/client/modules/IDE/components/Console.jsx @@ -87,8 +87,8 @@ const Console = () => { }, [theme, fontSize]); const cm = useRef({}); - const scrollConsoleDown = () => { cm.current.scrollTop = cm.current.scrollHeight; console.log('scroll'); }; - scrollConsoleDown(); + + useDidUpdate(() => { cm.current.scrollTop = cm.current.scrollHeight; }); const consoleClass = classNames({ 'preview-console': true,