File tree Expand file tree Collapse file tree 3 files changed +4
-647
lines changed Expand file tree Collapse file tree 3 files changed +4
-647
lines changed Original file line number Diff line number Diff line change @@ -27,20 +27,17 @@ SOFTWARE.
27
27
import { useEffect , useState } from 'react' ;
28
28
import { useTranslations } from 'next-intl' ;
29
29
import { useRouter } from 'next/router' ;
30
- import * as monaco from "monaco-editor" ;
30
+ import dynamic from 'next/dynamic' ;
31
+
32
+ const MonacoEditor = dynamic ( ( ) => import ( 'react-monaco-editor' ) , { ssr : false } ) ;
31
33
32
34
const Builder = ( ) => {
33
35
const translate = useTranslations ( ) ;
34
36
35
- monaco . editor . create ( document . getElementById ( 'monaco' ) , {
36
- value : "function hello() {\n\talert('Hello world!');\n}" ,
37
- language : 'javascript'
38
- } ) ;
39
-
40
37
return (
41
38
< div >
42
39
< span > { translate . raw ( 'builder-file' ) } </ span >
43
- < div id = "monaco" />
40
+ < MonacoEditor height = "600" language = "javascript" theme = "vs-dark" />
44
41
</ div >
45
42
)
46
43
}
You can’t perform that action at this time.
0 commit comments