use-document-visibility
Detects if current tab is active
Import
Source
Docs
Package
Usage
use-document-visibility
hook returns current document.visibilityState
– it allows detecting if the current tab is active:
Switch to another tab to see document title change