I have a project that's intended to make Code Mirror 6 as ready to use as any HTML tag: https://github.com/justinfagnani/codemirror-elements
You can put a basic code editor on your page like:
<cm-editor></cm-editor>
and drop in themes and modes like: <cm-editor>
<cm-lang-javascript typescript></cm-lang-javascript>
<cm-theme-one-dark></cm-theme-one-dark>
</cm-editor>
This works in plain HTML or any framework.