Skip to content

Commit

Permalink
Callback context on save 2
Browse files Browse the repository at this point in the history
  • Loading branch information
umerfaruk authored Mar 15, 2024
1 parent 91f94c1 commit 872febf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plugins/savePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { SAVE_COMMAND } from '../commands/saveCommand';
function SavePlugin({ format, onSave }) {
const [editor] = useLexicalComposerContext();

const saveCallback = useCallback(() => {
const saveCallback = () => {
if (format === "markdown") {
editor.update(() => {
const markdown = $convertToMarkdownString(TRANSFORMERS);
Expand All @@ -26,7 +26,7 @@ function SavePlugin({ format, onSave }) {
onSave(json);
}
}
}, [editor, format, onSave]);
};

useEffect(() => {
editor.registerCommand(
Expand Down

0 comments on commit 872febf

Please sign in to comment.