Monaco editor dynamically resizable
TL;DR: add automaticLayout: true to your editor’s configuration. NL;PR: Monaco has a built-in auto resize to parent container functionality: createEditorWithAutoResize(){ this.editor = monaco.editor.create( this.editorDiv.current, { value: “var x = 0;”, language: ‘javascript’, automaticLayout: true // <<== the important part } ); } componentDidMount(){this.createEditorWithAutoResize();} constructor(props){super(props); this.editorDiv = React.createRef();} render(){return <div ref={this.editorDiv} className=”editor” ></div>} And the CSS … Read more