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

Remove theme parameter from <Editor>: Theme, in monaco, is global.

Open Ivorforce opened this issue 2 years ago • 1 comments

The theme in monaco is, shockingly, a global variable, not a per-editor variable.

When a new <Editor> is created, it will set the theme. If no theme was explicitly set, it will set it to light. When you have multiple editors, this is wrong because spawning a new editor should not change the theme.

Instead, authors should be encouraged to set the theme themselves during beforeMount, with a hint that the theme is global.

Ivorforce avatar May 24 '23 01:05 Ivorforce

An alternative would be to not default to light: When no theme is passed (undefined), just don't call setTheme. I wouldn't do this because it still implies the wrong mindset about the 'theme' parameter being local, but it might be an easier sell because it won't break backward compatibility.

Ivorforce avatar May 24 '23 01:05 Ivorforce

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 Apr 03 '25 00:04 github-actions[bot]

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

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