suren-atoyan / monaco-react

Monaco Editor for React - use the monaco-editor in any React application without needing to use webpack (or rollup/parcel/etc) configuration files / plugins

Home Page:https://monaco-react.surenatoyan.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update internal TypeScript version in editor

MatchuPitchu opened this issue · comments

Is your feature request related to a problem? Please describe.
Is it possible to manually set the TypeScript version that the editor uses in the frontend or update the TypeScript version to the latest?
I use @monaco-editor/react as a playground for React components. Some of my components return the type ReactNode, which is absolutely ok up from TypeScript 5.1 onwards (see this part in an article). However, this is currently highlighted as an type error with the following text:

'MyComponent' cannot be used as a JSX component. Its return type 'ReactNode' is not a valid JSX element. Type 'string' is not assignable to type 'ReactElement<any, any>'.(2786)

Describe the solution you'd like

  • Developer can set manually the wished TypeScript version
  • monaco-editor uses always the latest TypeScript version

This issue should be addressed to microsoft/monaco-editor.

This might be related.