import { editor } from 'monaco-editor';
import Editor, {Monaco, useMonaco, loader , EditorProps} from '@monaco-editor/react';//DiffEditor,
......
<Editor
//height="100vh"
defaultLanguage="plaintext"
defaultValue={!fileContent?"":fileContent}
keepCurrentModel={true}
beforeMount={handleEditorWillMount}
onMount={handleEditorDidMount}
onChange={handleContentChange}
options={{
lineNumbers: 'off',
contextmenu: true,
roundedSelection: true,
cursorStyle: "line",
automaticLayout: true,
selectOnLineNumbers: true,
wordWrap: "off",
fontSize: 18,
minimap: {
enabled: false,
},
suggest: {},
}}
/>
as snippet from my nextjs project show above i want to turn on/off the “contextmenu” option to enable/disable the default monaco editor’s contextmenu ,but nothing showed or changed except the brower’s context menu pop when i right click in mocaco editor area.
and i also found some demo in codesandbox as follows:
they’re working ,but none of them embeded into nextjs.
any one can help me,
dependencies are list below:
“@monaco-editor/react”: “^4.6.0”,
“monaco-editor”: “^0.44.0”,
“next”: “^13”,
“react”: “^18”,