I'm currently working with react-monaco-editor and having trouble making it responsive. The component has a fixed height and width, so when I resize the screen, the width stays the same.
<MonacoEditor
width="1200"
height="600"
language="typescript"
theme="vs-dark"
defaultValue="//type your code here"
value={code}
options={options}
onChange={this.onChange}
editorDidMount={this.editorDidMount}
className='editor1'
/>
If I remove the width and height attributes from the component, it shrinks. I've tried using flex to override the component's styling, but it doesn't work as expected.
.react-monaco-editor-container {
flex: 2;
}
Could anyone provide some CSS tips on how to make this monaco editor responsive?