Skip to content

Commit

Permalink
fix(core): don't set editor content if value is undefined #441 (#442)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdrogdrog committed Dec 30, 2022
1 parent 3023dcd commit 0551523
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/src/useCodeMirror.ts
Expand Up @@ -181,6 +181,9 @@ export function useCodeMirror(props: UseCodeMirror) {
]);

useEffect(() => {
if (value === undefined) {
return;
}
const currentValue = view ? view.state.doc.toString() : '';
if (view && value !== currentValue) {
view.dispatch({
Expand Down

0 comments on commit 0551523

Please sign in to comment.