I use the react-codemirror2 in my react project, but the functions in defineMode not been excuted. Could you give an example about how to define "defineMode" on react-codemirror2, thank you!
I write the codes blow, but the console.log not been excuted.... <CodeMirror value={this.state.value} defineMode={{ name: "mywords", fn: function(){ console.log('defineMode fn') return { startState: function() {console.log('startState function'); return {inString: false};}, token: function(stream, state) { console.log('token function') stream.next() } } } }} />
I use the react-codemirror2 in my react project, but the functions in defineMode not been excuted. Could you give an example about how to define "defineMode" on react-codemirror2, thank you!
I write the codes blow, but the console.log not been excuted....
<CodeMirror value={this.state.value} defineMode={{ name: "mywords", fn: function(){ console.log('defineMode fn') return { startState: function() {console.log('startState function'); return {inString: false};}, token: function(stream, state) { console.log('token function') stream.next() } } } }} />