diff --git a/client/web/src/components/KeepAliveOverlay/withKeepAliveOverlay.tsx b/client/web/src/components/KeepAliveOverlay/withKeepAliveOverlay.tsx index 27c341e5..d1e7fe5b 100644 --- a/client/web/src/components/KeepAliveOverlay/withKeepAliveOverlay.tsx +++ b/client/web/src/components/KeepAliveOverlay/withKeepAliveOverlay.tsx @@ -19,7 +19,9 @@ export function withKeepAliveOverlay< OP extends Omit = Omit >( OriginComponent: React.ComponentType, - config: { cacheId: string | ((props: OP) => string) } + config: { + cacheId: string | ((props: OP) => string); + } ) { // eslint-disable-next-line react/display-name return (props: P) => { @@ -32,7 +34,7 @@ export function withKeepAliveOverlay< } return config.cacheId; - }, []); + }, [originProps]); useEffect(() => { mount(cacheId, ); @@ -40,7 +42,7 @@ export function withKeepAliveOverlay< return () => { hide(cacheId); }; - }, []); + }, [cacheId]); useEffect(() => { if (!containerRef.current) { @@ -72,7 +74,7 @@ export function withKeepAliveOverlay< resizeObserver.unobserve(containerRef.current); } }; - }, []); + }, [cacheId]); return (