react-observe-visibility
v1.0.0
Published
Observe React component visibility in the viewport or visibility relative to an ancestor
Downloads
2
Maintainers
Readme
Observe Visibility
Summary
Observe React component visibility in the viewport or visibility relative to an ancestor.
Installation
$ npm install observe-visibility
$ yarn add observe-visibility
Usage
Example:
<ObserveVisibility>
{({ isVisible }) => {
isVisible && doSomething();
return <Placeholder />;
}}
</ObserveVisibility>
Contributing
If you are interested in contributing, please submit a pull request.