Move console scroll to useDidUpdate

This commit is contained in:
Cassie Tarakajian 2020-08-17 15:55:34 -04:00
parent f1b2cb5ee0
commit ba0794ab5a

View file

@ -87,8 +87,8 @@ const Console = () => {
}, [theme, fontSize]); }, [theme, fontSize]);
const cm = useRef({}); 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({ const consoleClass = classNames({
'preview-console': true, 'preview-console': true,