diff --git a/src/components/MonacoCodeEditor/MonacoCodeEditor.js b/src/components/MonacoCodeEditor/MonacoCodeEditor.js index 6272e9f..39198a4 100644 --- a/src/components/MonacoCodeEditor/MonacoCodeEditor.js +++ b/src/components/MonacoCodeEditor/MonacoCodeEditor.js @@ -87,6 +87,16 @@ const MonacoCodeEditor = React.forwardRef((props, ref) => { editor.current = _editor; }, []); + /** + * On change Code + */ + React.useEffect(() => { + const currentValue = editor.current?.getValue(); + if (editor.current && currentValue !== value) { + editor.current.setValue(value); + } + }, [value]); + /** * On change Theme */