From 01648d262d1877797778cd9fbd51d69a79287f0f Mon Sep 17 00:00:00 2001 From: Ben Elferink Date: Tue, 3 Dec 2024 11:00:58 +0200 Subject: [PATCH] [GEN-1850]: unmount component when animated out (#1906) --- frontend/webapp/hooks/common/useTransition.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/webapp/hooks/common/useTransition.tsx b/frontend/webapp/hooks/common/useTransition.tsx index beae4cf62..cbc3ede01 100644 --- a/frontend/webapp/hooks/common/useTransition.tsx +++ b/frontend/webapp/hooks/common/useTransition.tsx @@ -29,6 +29,8 @@ export const useTransition = ({ container, animateIn, animateOut, duration = 300 return () => clearTimeout(t); }, [enter, duration]); + if (!enter && !mounted) return null; + return ( {children}