From 872febf433d9458f41fc9211be794dabe6a31d6f Mon Sep 17 00:00:00 2001 From: Omar Faruk Date: Fri, 15 Mar 2024 17:31:52 +0000 Subject: [PATCH] Callback context on save 2 --- src/plugins/savePlugin.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/savePlugin.js b/src/plugins/savePlugin.js index b16b332..e542cb3 100644 --- a/src/plugins/savePlugin.js +++ b/src/plugins/savePlugin.js @@ -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); @@ -26,7 +26,7 @@ function SavePlugin({ format, onSave }) { onSave(json); } } - }, [editor, format, onSave]); + }; useEffect(() => { editor.registerCommand(