From c33280bbb2aad8dd1f12d19fb5c56d6072a3a9e3 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 22 Aug 2025 23:45:31 +0300 Subject: [PATCH] chore(react): fix leak & adjustable class name --- apps/client/src/widgets/react/hooks.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/client/src/widgets/react/hooks.tsx b/apps/client/src/widgets/react/hooks.tsx index a1654eb42..1a5be3e62 100644 --- a/apps/client/src/widgets/react/hooks.tsx +++ b/apps/client/src/widgets/react/hooks.tsx @@ -414,8 +414,9 @@ export function useNoteBlob(note: FNote | null | undefined): [ FBlob | null | un return [ blob ] as const; } -export function useLegacyWidget(widgetFactory: () => BasicWidget, { noteContext }: { +export function useLegacyWidget(widgetFactory: () => BasicWidget, { noteContext, containerClassName }: { noteContext?: NoteContext; + containerClassName?: string; } = {}) { const ref = useRef(null); const parentComponent = useContext(ParentComponent); @@ -434,7 +435,7 @@ export function useLegacyWidget(widgetFactory: () => BasicWidget, { noteContext const renderedWidget = widget.render(); return [ widget, renderedWidget ]; - }, [widgetFactory]); + }, []); // Attach the widget to the parent. useEffect(() => { @@ -452,5 +453,5 @@ export function useLegacyWidget(widgetFactory: () => BasicWidget, { noteContext } }, [ noteContext ]); - return
+ return
} \ No newline at end of file