@@ -5,7 +5,11 @@ import hljs from 'highlight.js/lib/core'
55import javascript from 'highlight.js/lib/languages/javascript'
66import debounce from 'lodash.debounce'
77import ms from 'ms'
8- import { Controlled as CodeMirror } from 'react-codemirror2'
8+
9+ const CodeMirror = dynamic (
10+ ( ) => import ( 'react-codemirror2' ) . then ( mod => mod . Controlled ) ,
11+ { ssr : false }
12+ ) ;
913
1014hljs . registerLanguage ( 'javascript' , javascript )
1115
@@ -209,15 +213,15 @@ class Carbon extends React.PureComponent {
209213 light = { light }
210214 />
211215 ) : null }
212- < CodeMirror
213- ref = { this . props . editorRef }
214- className = { `CodeMirror__container window-theme__${ config . windowTheme } ` }
215- value = { this . props . children }
216- options = { options }
217- onBeforeChange = { this . onBeforeChange }
218- onGutterClick = { this . props . onGutterClick }
219- onSelection = { this . onSelection }
220- />
216+ < CodeMirror
217+ ref = { this . props . editorRef }
218+ className = { `CodeMirror__container window-theme__${ config . windowTheme } ` }
219+ value = { this . props . children }
220+ options = { options }
221+ onBeforeChange = { this . onBeforeChange }
222+ onGutterClick = { this . props . onGutterClick }
223+ onSelection = { this . onSelection }
224+ />
221225 { config . watermark && < Watermark light = { light } /> }
222226 < div className = "container-bg" >
223227 < div className = "white eliminateOnRender" />
0 commit comments