diff --git a/components/Carbon.js b/components/Carbon.js index 5341d63..147d94e 100644 --- a/components/Carbon.js +++ b/components/Carbon.js @@ -102,7 +102,7 @@ class Carbon extends React.Component { {config.windowControls ? : null} this.codeUpdated(code)} + onBeforeChange={(editor, meta, code) => this.codeUpdated(code)} value={this.props.children} options={options} /> diff --git a/lib/react-codemirror.js b/lib/react-codemirror.js index 47b4382..2794664 100644 --- a/lib/react-codemirror.js +++ b/lib/react-codemirror.js @@ -1,6 +1,6 @@ // For SSR, CodeMirror will throw an error, so return a div instead let CodeMirror = 'div' if (typeof window !== 'undefined' && typeof window.navigator !== 'undefined') { - CodeMirror = require('react-codemirror2').UnControlled + CodeMirror = require('react-codemirror2').Controlled } export default CodeMirror