react-codemirror
react-codemirror copied to clipboard
Expose CodeMirror library
I'm trying to use Firebase's Firepad with this component. Firepad is expecting a global CodeMirror object, which it doesn't find unless I include the library separately. Perhaps it is a given that this conflicts with this component? Is there a way to expose the CodeMirror library within a component, so that it is available to Firepad? Apologies if this is the wrong place to ask this.
this.refs.editor.getCodeMirror()
if you have bound your codemirror instance through ref="editor"
.
Edit: I just noticed #33. It seems the CodeMirror instance returned isn't a full instance...
Incase anyone is looking at the issue, continuing on @guidobouman's statement, you can now use:
this.refs.editor.getCodeMirrorInstance()
to get the full CodeMirror instance, not just the editor.
For universal apps you can do something like:
global.CodeMirror = this.refs.editor.getCodeMirrorInstance();
If this issue still persists please give react-codemirror2 a look. I'm planning on maintaining this moving forward. Better docs will be coming. Feel free to open up any issues/suggestions as I'll be trying to gather as much constructive feedback from the community moving forward