react-codemirror
react-codemirror copied to clipboard
Uncaught TypeError: Cannot read property 'setOption' of undefined
Hi
I receive Uncaught TypeError: Cannot read property 'setOption' of undefined, which happens in componentWillReceiveProps at line 50.
this.codeMirror.setOption(optionName, nextProps.options[optionName]);
For some reason, it seems that componentWillReceiveProps triggers before componentDidMount, so this.codeMirror is not yet defined.
The event also triggers after componentDidMount, though.
I am also seeing this.
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