Skip to content

Commit 244867e

Browse files
author
Loïc Mangeonjean
committed
fix: forgot editor when disposed
1 parent 1efbac5 commit 244867e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/MonacoEditor.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ function MonacoEditor ({
170170
lastSaveViewState(editorRef.current!, model)
171171
if (existingModel == null) {
172172
// Only dispose if we are the one who created the model
173+
modelRef.current = undefined
173174
model.dispose()
174175
}
175176
}
@@ -216,6 +217,7 @@ function MonacoEditor ({
216217
}
217218

218219
return () => {
220+
editorRef.current = undefined
219221
editor.dispose()
220222
}
221223
}

0 commit comments

Comments
 (0)