Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function useActiveAppId(registry) {
const [appId, set] = useState('')
useEventListener('single-spa:routing-event', () => {
const activeApp = registry.getActiveApp()
if (activeApp) {
set(activeApp.id)
}
})
return appId
}
function AppearAnimate({
className,
motionName,
children,
}: IAppearAnimateProps) {
const [isFirst, setIsFirst] = useState(true)
const handleAnimationEnd = useCallback(() => {
setIsFirst(false)
}, [])
const ref = useRef(null)
useEventListener('animationend', handleAnimationEnd, { target: ref })
return (
<div>
{children}
</div>
)
}