observe-visibility

1.0.0 • Public • Published

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.

License

MIT

Package Sidebar

Install

npm i observe-visibility

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

2.75 kB

Total Files

4

Last publish

Collaborators

  • atshakil