I am trying to reference data into reactJS along with typescript. While doing this I am getting below error
Type \'null\' is not assignable to type \'HTMLInputEl
I solved in react using if condition before i use ref
if (this.ref.current) { this.editor = monaco.editor.create( this.ref.current, { automaticLayout: true } ); monaco.editor.setTheme('vs-dark'); this.editor.setModel(this.model); }