#737 - fix language prop when using existing text model (#738)

This commit is contained in:
Louis 2025-10-12 18:44:27 +02:00 committed by GitHub
parent b73ec13688
commit 225d3fa258
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -118,9 +118,11 @@ function Editor({
useUpdate(
() => {
const model = editorRef.current?.getModel();
if (model && language) monacoRef.current?.editor.setModelLanguage(model, language);
if (isEditorReady && model && language) {
monacoRef.current?.editor.setModelLanguage(model, language);
}
},
[language],
[language, isEditorReady],
isEditorReady,
);