File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import React from 'react' ;
2- import { observer } from 'mobx-react' ;
1+ import React , { useRef , useEffect , useCallback } from 'react' ;
2+ import { observer } from 'mobx-react-lite ' ;
33import PropTypes from 'prop-types' ;
44import Box from '@mui/material/Box' ;
55
6- @observer
7- class Console extends React . Component {
8- keepToBottom = true ;
6+ const Console = observer ( ( { run } ) => {
7+ const stdoutContainerRef = useRef ( null ) ;
98
10- onMountStdoutContainer = el => {
11- this . stdoutContainer = el ;
12- } ;
139
1410 componentDidUpdate ( ) {
1511 if ( this . keepToBottom ) {
@@ -30,7 +26,6 @@ class Console extends React.Component {
3026 this . stdoutContainer . scrollTop = diff ;
3127 } ;
3228
33- render ( ) {
3429 const { run } = this . props ;
3530 return (
3631 < Box
@@ -82,9 +77,9 @@ class Console extends React.Component {
8277 ) }
8378 </ div >
8479 </ Box >
85- ) ;
86- }
87- }
80+ return (
81+ ) ;
82+ } ) ;
8883
8984Console . propTypes = {
9085 run : PropTypes . object . isRequired
You can’t perform that action at this time.
0 commit comments