uiwjs / react-monacoeditor

Monaco Editor component for React.

Home Page:https://uiwjs.github.io/react-monacoeditor/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React render two Editors instead of one

skorotkiewicz opened this issue · comments

Console log:

Uncaught Error: Unexpected usage

loadForeignModule@http://localhost:3000/static/js/bundle.js:130741:27
./node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/editor/browser/services/webWorker.js/_getForeignProxy/this._foreignProxy<@http://localhost:3000/static/js/bundle.js:79060:22

I'm installed react-monacoeditor on new CRA app with React 18.0.1 and add one editor, but react renders instead two.

The first window has class: overflow-guard
The second: monaco-editor no-user-select mac showUnused showDeprecated vs-dark

I'm tested it on Firefox, Opera and Chromium with the same results.
OS: macOS Big Sur.

Screenshot 2022-05-02 at 20 31 49

How can I fix it?

I have the same problem here

Any idea of why this might be happening, I have the same issue, react version 18.1.0

This must be a React 18 issue, something to do with concurrent mode or transitions I bet.

This is hugely affecting our LOB apps. I'll report back if I find any fixes.

I had to revert away from React 18, which fixed this issue for me.

Upgrade v3.5.4