Skip to content

Commit 04f3a1e

Browse files
committed
Consider actions a dependency of Monaco Editor.
Otherwise the component isn't regenerated when the actions change. In this particular case, the `runCode` callback is the one that would change and cause missed re-renders.
1 parent 10cce9a commit 04f3a1e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/monaco.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export function Editor({ state, actions = [], padding, focus = false }: EditorPr
6363
resizeObserver.disconnect();
6464
editorRef.current?.dispose();
6565
};
66-
}, []);
66+
}, [actions]);
6767

6868
return <div style={{ height: '100%' }} ref={containerRef}/>;
6969
}

0 commit comments

Comments
 (0)