@rehooks/document-visibility-hook

1.0.0 • Public • Published

@rehooks/document-visibility-hook

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 document-visibility-hook

Usage

import useDocumentVisibility from 'document-visibility-hook';

function MyComponent() {
  let visible = useDocumentVisibility();
  // true || false

  // ...
}

Package Sidebar

Install

npm i @rehooks/document-visibility-hook

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

3.21 kB

Total Files

5

Last publish

Collaborators

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