Skip to content

Commit 0551523

Browse files
authoredDec 30, 2022
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

+3
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)
Please sign in to comment.