Skip to content

Commit

Permalink
fix: load async value
Browse files Browse the repository at this point in the history
  • Loading branch information
tiavina-mika committed Jul 29, 2024
1 parent a6c0d3a commit 52057cd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/hooks/useTextEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ export const useTextEditor = ({
// if (editor.isDestroyed) return;
if (!(value && editor.isEmpty)) return;
editor.commands.setContent(value);
// !important: to avoid update for each taping, the value should be excluded from the dependencies
}, [editor]);
}, [editor, value]);


// useEffect(() => {
Expand Down

0 comments on commit 52057cd

Please sign in to comment.