mirror of
https://github.com/suren-atoyan/monaco-react.git
synced 2026-01-25 16:02:35 +00:00
use @monaco-editor/loader instead of 'monaco' utility
This commit is contained in:
parent
a5d107cd3d
commit
a44bfd82e8
@ -1,11 +1,11 @@
|
||||
import React, { useState, useRef, useCallback, useEffect } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import monaco from '@monaco-editor/loader';
|
||||
|
||||
import MonacoContainer from '../MonacoContainer';
|
||||
|
||||
import { monaco, noop } from '../utils';
|
||||
import { useMount, useUpdate } from '../hooks';
|
||||
|
||||
import useMount from '../hooks/useMount';
|
||||
import useUpdate from '../hooks/useUpdate';
|
||||
import { noop } from '../utils';
|
||||
import themes from '../config/themes';
|
||||
|
||||
function DiffEditor ({
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import monaco from '@monaco-editor/loader';
|
||||
|
||||
import MonacoContainer from '../MonacoContainer';
|
||||
|
||||
import { monaco, noop } from '../utils';
|
||||
import { useMount, useUpdate } from '../hooks';
|
||||
|
||||
import useMount from '../hooks/useMount';
|
||||
import useUpdate from '../hooks/useUpdate';
|
||||
import { noop } from '../utils';
|
||||
import themes from '../config/themes';
|
||||
|
||||
function Editor({
|
||||
@ -87,6 +87,10 @@ function Editor({
|
||||
...options,
|
||||
}, overrideServices);
|
||||
|
||||
// the next line is here historically
|
||||
// by default, monaco-editor provides two themes: 'light' and 'vs-dark'
|
||||
// so, now you have one as a bonus: 'dark' :)
|
||||
// I don't want to delete it, just to not make breaking changes
|
||||
monacoRef.current.editor.defineTheme('dark', themes['night-dark']);
|
||||
monacoRef.current.editor.setTheme(theme);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user