@rehooks/document-visibility
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

@rehooks/document-visibility

React hook for subscribing to document visibility

Note: This is using the new React Hooks API Proposal which is subject to change until React 16.7 final.

You'll need to install react, react-dom, etc at ^16.7.0-alpha.0

Install

yarn add @rehooks/document-visibility

Usage

import useDocumentVisibility from '@rehooks/document-visibility';

function MyComponent() {
  let documentVisibility = useDocumentVisibility();
  // documentVisibility = "hidden" | "visible" | "prerender"

  // ...
}

Package Sidebar

Install

npm i @rehooks/document-visibility

Weekly Downloads

643

Version

1.2.0

License

MIT

Unpacked Size

3.55 kB

Total Files

6

Last publish

Collaborators

  • fouad
  • hanford
  • iamsolankiamit
  • jmoxey
  • mathdroid
  • thejameskyle