From 2f086e993bcafd0d982c3de5f2bacc880397164b Mon Sep 17 00:00:00 2001 From: Wolfie <32025746+Wolfkid200444@users.noreply.github.com> Date: Sun, 10 Mar 2024 08:17:16 -0400 Subject: [PATCH] Refactor NotebookDeleteModal component to remove unnecessary useEffect hook --- .../components/modals/NotebookDeleteModal.tsx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/plugins/holynotes/components/modals/NotebookDeleteModal.tsx b/src/plugins/holynotes/components/modals/NotebookDeleteModal.tsx index f7a9592e8..261bda316 100644 --- a/src/plugins/holynotes/components/modals/NotebookDeleteModal.tsx +++ b/src/plugins/holynotes/components/modals/NotebookDeleteModal.tsx @@ -13,15 +13,7 @@ import Error from "./Error"; import { RenderMessage } from "./RenderMessage"; export default ({ onClose, notebook, ...props }: ModalProps & { onClose: () => void; notebook: string; }) => { - const [notes, setNotes] = React.useState({}); - - React.useEffect(() => { - const update = async () => { - const notes = await noteHandler.getNotes(notebook); - setNotes(notes); - }; - update(); - }, []); + const notes = noteHandler.getNotes(notebook); if (!notes) return <>;