From a2e06d1fee2922d9ea810a562b62c4800d402d4b Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 12 Jul 2025 00:09:35 +1000 Subject: [PATCH] Reduce plugin component reloads (#10010) --- .../components/plugins/RemoteComponent.tsx | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/components/plugins/RemoteComponent.tsx b/src/frontend/src/components/plugins/RemoteComponent.tsx index 71a586ed87..490a847bac 100644 --- a/src/frontend/src/components/plugins/RemoteComponent.tsx +++ b/src/frontend/src/components/plugins/RemoteComponent.tsx @@ -111,12 +111,28 @@ export default function RemoteComponent({ `${t`Invalid source or function name`} - ${source} /${func}` ); } - }, [componentRef, rootElement, source, defaultFunctionName, context]); + }, [ + componentRef.current, + rootElement.current, + source, + defaultFunctionName, + context + ]); // Reload the plugin content dynamically useEffect(() => { reloadPluginContent(); - }, [func, context, rootElement.current]); + }, [ + func, + rootElement.current, + context.id, + context.model, + context.instance, + context.user, + context.colorScheme, + context.locale, + context.context + ]); return (