Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bogeyman76/documentvisible
A React hook to monitor if the current browser tab is visible or not.
https://github.com/bogeyman76/documentvisible
javascript jsx react react-hook typescript-react
Last synced: 19 days ago
JSON representation
A React hook to monitor if the current browser tab is visible or not.
- Host: GitHub
- URL: https://github.com/bogeyman76/documentvisible
- Owner: bogeyman76
- License: gpl-3.0
- Created: 2024-10-21T17:20:28.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-10-21T17:41:58.000Z (3 months ago)
- Last Synced: 2024-11-01T17:06:48.408Z (2 months ago)
- Topics: javascript, jsx, react, react-hook, typescript-react
- Language: TypeScript
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
DocumentVisible React Hook
This is a simple react hook to determine if the current browser tab is visible. The hook uses uses Reacts useSyncExternalStore:
https://react.dev/reference/react/useSyncExternalStore
Implentation:
const isVisible = DocumentVisible(); // true or false