scniro / react-codemirror2

Codemirror integrated components for React
MIT License
1.66k stars 193 forks source link

defineMode not been excuted #211

Open wurijie opened 4 years ago

wurijie commented 4 years ago

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() } } } }} />