How to use @typefox/monaco-editor-react
with vite
#665
-
Hi, I'm currently trying to create a React application using Could you please provide me with a minimal functional example? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hi @Yokozuna59 that is strange because we use this combination for the examples here and I quite recently fixed multiple issues with vite/rollup production builds. We don't have a minimum functional example here, but only examples that make use of a language server: A minimum configuration can be something like this: const htmlElement = document.getElementById('monaco-editor-root');
const comp = <MonacoEditorReactComp
userConfig={{
wrapperConfig: {
editorAppConfig: {
$type: 'classic',
codeResources: {},
useDiffEditor: false
}
}
}}
style={{
'paddingTop': '5px',
'height': '80vh'
}}
ReactDOM.createRoot(htmlElement!).render({comp}); |
Beta Was this translation helpful? Give feedback.
Hi @Yokozuna59 that is strange because we use this combination for the examples here and I quite recently fixed multiple issues with vite/rollup production builds. We don't have a minimum functional example here, but only examples that make use of a language server:
https://github.com/TypeFox/monaco-languageclient/tree/main/packages/examples/src/python/client/reactPython.tsx
https://github.com/TypeFox/monaco-languageclient/tree/main/packages/examples/src/langium/statemachine/main-react.tsx
A minimum configuration can be something like this: