Skip to content

Commit 2ea9a30

Browse files
Justin WilkersonJustin Wilkerson
Justin Wilkerson
authored and
Justin Wilkerson
committed
Bug fixes.
1 parent 695bf2e commit 2ea9a30

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/index.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ const customPlugin: import("./plugin/vendor/playground").PlaygroundPlugin = {
2727
},
2828
modelChangedDebounce(_, model) {
2929
createCustomEvent("modelChangedDebounce", model);
30+
},
31+
willUnmount(_, container) {
32+
ReactDOM.unmountComponentAtNode(container);
3033
}
3134
};
3235

src/plugin/Provider.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ export const Provider: React.FC<ProviderProps> = ({
4242
}, []);
4343

4444
useEffect(() => {
45-
sandbox.editor.onDidChangeModelDecorations(() => {
45+
const disposable = sandbox.editor.onDidChangeModelDecorations(() => {
4646
const allMarkers = sandbox.monaco.editor.getModelMarkers({});
4747
setMarkers(allMarkers);
4848
});
49+
() => disposable.dispose();
4950
}, []);
5051

5152
useEffect(() => {

0 commit comments

Comments
 (0)