@brightleaf/react-hooks
Advanced tools
Comparing version 0.16.0 to 0.17.0
@@ -78,2 +78,8 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "usePageVisibility", { | ||
enumerable: true, | ||
get: function () { | ||
return _usePageVisibility.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "usePost", { | ||
@@ -146,2 +152,4 @@ enumerable: true, | ||
var _usePageVisibility = _interopRequireDefault(require("./use-page-visibility")); | ||
var _usePost = _interopRequireDefault(require("./use-post")); | ||
@@ -148,0 +156,0 @@ |
{ | ||
"name": "@brightleaf/react-hooks", | ||
"version": "0.16.0", | ||
"version": "0.17.0", | ||
"description": "Useful react hooks", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -21,2 +21,3 @@ # Brightleaf React Hooks | ||
* `useStyleSheet` - Hook to add a css file to the page | ||
* `usePageVisibility` - Hook to use the page visibility api | ||
@@ -377,2 +378,19 @@ [Examples](https://brightleaf.github.io/react-hooks/examples/#/) | ||
} | ||
``` | ||
``` | ||
## PageVisibility Hook | ||
```javascript | ||
import React from 'react' | ||
import { usePageVisibility } from '@brightleaf/react-hooks' | ||
export default () => { | ||
const { visible, hidden } = usePageVisibility() | ||
return ( | ||
<div> | ||
... | ||
</div> | ||
); | ||
} | ||
``` |
45109
29
1258
395