Closed stoplion closed 6 years ago
Closing for total absence of detail
Change this to UnControlled and it will work
@stoplion You're using the component incorrectly. Did you look at the docs? I thought the examples were pretty clear. There's even a demo site!
import {Controlled as CodeMirror} from 'react-codemirror2'
<CodeMirror
value={this.state.value}
options={options}
onBeforeChange={(editor, data, value) => {
this.setState({value}); // state management here
}}
onChange={(editor, data, value) => {
// downstream callback
}}
/>
ok makes sense thx
onChange not working for Controlled