, {}> {
private editorRef: ReactCodeMirror.ReactCodeMirror;
componentDidMount() {
this.editorRef.focus();
this.editorRef.getCodeMirror();
}
render() {
const options = {
lineNumbers: true,
readOnly: false,
mode: "markdown"
};
const onChange = (value: any) => console.log(value);
const onFocusChange = (focused: boolean) => console.log(focused);
const onScroll = (scrollInfo: CodeMirror.ScrollInfo) => console.log(scrollInfo.top);
const codeMirrorInstance = CodeMirror(document.body);
return
this.editorRef = r}
value="foo bar" />
;
}
}