Merge pull request #897 from palash-signoz/896-monaco-editor-change

chore: onChange event is added
This commit is contained in:
Ankit Nayan 2022-03-23 19:43:59 +05:30 committed by GitHub
commit b958bad81f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,6 +9,12 @@ function Editor({ value }: EditorProps): JSX.Element {
value={value.current} value={value.current}
options={{ fontSize: 16, automaticLayout: true }} options={{ fontSize: 16, automaticLayout: true }}
height="40vh" height="40vh"
onChange={(newValue): void => {
if (value.current && newValue) {
// eslint-disable-next-line no-param-reassign
value.current = newValue;
}
}}
/> />
); );
} }