the below code work ffine when the browser reloaded , but not on the teams reload tab,
useEffect(() => {
window.addEventListener('beforeunload', leaveEvent)
return () => {
window.removeEventListener('beforeunload', leaveEvent)
}
}, [data])
but when i reload the entire browser teams tab it works fine , but not on click of team reload tab .
i wanted to know is their way to listen to teams reload tab, or when we move to any of the other team app like chat or team from the personal tan