Skip to content

Commit 0551523

Browse files
authored
fix(core): don't set editor content if value is undefined #441 (#442)
1 parent 3023dcd commit 0551523

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/src/useCodeMirror.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ export function useCodeMirror(props: UseCodeMirror) {
181181
]);
182182

183183
useEffect(() => {
184+
if (value === undefined) {
185+
return;
186+
}
184187
const currentValue = view ? view.state.doc.toString() : '';
185188
if (view && value !== currentValue) {
186189
view.dispatch({

0 commit comments

Comments
 (0)