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