🐛 fix: Only update internalValue in MonacoEditor if propValue has changed
This commit is contained in:
parent
ba65588fdf
commit
fe14002359
@ -60,7 +60,10 @@ export function MonacoEditor({
|
|||||||
const size = useSize(ref);
|
const size = useSize(ref);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setInternalValue(propValue);
|
// Only update internalValue if propValue has actually changed and is different from current value
|
||||||
|
if (propValue !== internalValue) {
|
||||||
|
setInternalValue(propValue);
|
||||||
|
}
|
||||||
}, [propValue]);
|
}, [propValue]);
|
||||||
|
|
||||||
const debouncedOnChange = useRef(
|
const debouncedOnChange = useRef(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user