react-froala-wysiwyg
react-froala-wysiwyg copied to clipboard
How to use codemirror 6 with froala?
When integrating Codemirror I found a few old issues that were helpful. Ended up with this code:
import CodeMirror from "codemirror";
import 'codemirror/lib/codemirror.css';
import 'codemirror/mode/xml/xml.js';
<FroalaEditorComponent
tag="textarea"
config={
codeMirror: CodeMirror,
...
}
/>
This works when I lock codemirror to v5
"codemirror": "^5",
When I use the new codemirror I get the following errors
SyntaxError: The requested module '/node_modules/.vite/deps/codemirror.js?v=c62307cd' does not provide an export named 'default' (at froalaConfig.ts:11:8)
✘ [ERROR] Missing "./lib/codemirror.css" specifier in "codemirror" package [plugin vite:dep-scan]
✘ [ERROR] Missing "./mode/xml/xml.js" specifier in "codemirror" package [plugin vite:dep-scan]
How can I correctly import v6 into Froala?