Skip to content

Commit

Permalink
fix: dispose of editor in effect cleanup (#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
cs-miller authored Jul 11, 2022
1 parent 80dea3c commit a24b29a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ function MonacoEditor(props: MonacoEditorProps, ref: ((instance: RefEditorInstan
throw new Error('Failed to load font codicon!!');
}
});

return () => {
if(editor.current) {
editor.current.dispose()
}
}
}, []);

useEffect(() => {
Expand Down

0 comments on commit a24b29a

Please sign in to comment.