Skip to content

Commit ef69f45

Browse files
committed
remove effect
1 parent e108e58 commit ef69f45

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/components/YamlEditor/YamlEditor.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Editor } from '@monaco-editor/react';
22
import type { ComponentProps } from 'react';
33
import { Button, Panel, Toolbar, ToolbarSpacer, Title } from '@ui5/webcomponents-react';
44
import { parseDocument } from 'yaml';
5-
import { useCallback, useEffect, useMemo, useState } from 'react';
5+
import { useCallback, useMemo, useState } from 'react';
66
import { useTheme } from '../../hooks/useTheme';
77
import { GITHUB_DARK_DEFAULT, GITHUB_LIGHT_DEFAULT } from '../../lib/monaco.ts';
88
import { useTranslation } from 'react-i18next';
@@ -23,12 +23,6 @@ export const YamlEditor = (props: YamlEditorProps) => {
2323
const [validationErrors, setValidationErrors] = useState<string[]>([]);
2424
const [applyAttempted, setApplyAttempted] = useState(false);
2525

26-
useEffect(() => {
27-
if (typeof value !== 'undefined') {
28-
setEditorContent(value.toString());
29-
}
30-
}, [value]);
31-
3226
const enforcedOptions: monaco.editor.IStandaloneEditorConstructionOptions = useMemo(
3327
() => ({
3428
...(options as monaco.editor.IStandaloneEditorConstructionOptions),

0 commit comments

Comments
 (0)