Skip to content

Commit

Permalink
reproduce visibility change bug
Browse files Browse the repository at this point in the history
  • Loading branch information
NGimbal committed Dec 8, 2024
1 parent a7699ff commit e0e54c0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,18 @@ function App() {
const searchBar = isOnSearchPage ? null : <SearchBar status="idle" />
useToast(data.toast)

useEffect(() => {
const handleVisibilityChange = (e: any) => {
console.log('visibility changed', e)
}

document.addEventListener('visibilitychange', handleVisibilityChange)

return () => {
document.removeEventListener('visibilitychange', handleVisibilityChange)
}
}, [])

return (
<>
<div className="flex min-h-screen flex-col justify-between">
Expand Down

0 comments on commit e0e54c0

Please sign in to comment.