Skip to content

Commit

Permalink
[GEN-1850]: unmount component when animated out (#1906)
Browse files Browse the repository at this point in the history
  • Loading branch information
BenElferink authored Dec 3, 2024
1 parent a9f1d05 commit 01648d2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frontend/webapp/hooks/common/useTransition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export const useTransition = ({ container, animateIn, animateOut, duration = 300
return () => clearTimeout(t);
}, [enter, duration]);

if (!enter && !mounted) return null;

return (
<Animated $isEntering={enter} $isLeaving={!enter && mounted} {...props}>
{children}
Expand Down

0 comments on commit 01648d2

Please sign in to comment.