monaco-react icon indicating copy to clipboard operation
monaco-react copied to clipboard

How to refer to the monaco type

Open DreamGhostStar opened this issue 2 years ago • 2 comments

Describe the bug @monaco-editor/react seems to request monaco-editor files by way of cdn, so how do I use the monaco.editor.IStandaloneCodeEditor type in my code, I get an error when I refer to monaco-editor/esm/vs/editor/editor.api image It seems impossible to introduce, but I have to use this type in useRef.

version @monaco-editor/react: 4.4.6

DreamGhostStar avatar Jun 12 '23 09:06 DreamGhostStar

@DreamGhostStar try

import { type editor } from 'monaco-editor';

...

editor.IStandaloneCodeEditor

suren-atoyan avatar Jun 15 '23 05:06 suren-atoyan

@suren-atoyan No, it doesn't seem to work because I don't have a monaco-editor dependency image

DreamGhostStar avatar Jun 19 '23 02:06 DreamGhostStar

This issue has been marked as stale due to inactivity. It will be closed in 7 days unless further activity occurs.

github-actions[bot] avatar Mar 30 '25 00:03 github-actions[bot]

Closing due to inactivity. Feel free to reopen if needed.

github-actions[bot] avatar Apr 07 '25 00:04 github-actions[bot]