Skip to content
Discussion options

You must be logged in to vote

Managed to work it out myself by doing the following:

npm install monaco-themes

then

import Editor, { DiffEditor, useMonaco, loader } from "@monaco-editor/react";
import "monaco-themes/themes/Monokai Bright.json";

function App() {
  const monaco = useMonaco();

  useEffect(() => {
    if (monaco) {
      console.log("here is the monaco isntance:", monaco);
      import('monaco-themes/themes/Monokai Bright.json')
        .then(data => {
          monaco.editor.defineTheme('monokai-bright', data);
        })
        .then(_ => monaco.editor.setTheme('monokai-bright'))
      // monaco.editor.defineTheme("monokai-bright").then(_ => monaco.editor.setMonacoTheme("monokai-bright"));
    }
  }, [m…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ItsMeStevieG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant