mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-17 18:26:32 +00:00
Reduce plugin component reloads (#10010)
This commit is contained in:
@@ -111,12 +111,28 @@ export default function RemoteComponent({
|
|||||||
`${t`Invalid source or function name`} - ${source} /${func}`
|
`${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
|
// Reload the plugin content dynamically
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
reloadPluginContent();
|
reloadPluginContent();
|
||||||
}, [func, context, rootElement.current]);
|
}, [
|
||||||
|
func,
|
||||||
|
rootElement.current,
|
||||||
|
context.id,
|
||||||
|
context.model,
|
||||||
|
context.instance,
|
||||||
|
context.user,
|
||||||
|
context.colorScheme,
|
||||||
|
context.locale,
|
||||||
|
context.context
|
||||||
|
]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Boundary label={identifierString(`RemoteComponent-${func}`)}>
|
<Boundary label={identifierString(`RemoteComponent-${func}`)}>
|
||||||
|
Reference in New Issue
Block a user