1.0.6 • Published 4 years ago

react-observer-component v1.0.6

Weekly downloads
6
License
-
Repository
github
Last release
4 years ago

React intersection Observer

React custom hook that uses the Intersection observer API.

Codesandbox demo

Getting started

npm install react-observer-component

Usage

import React from 'react';
import useObserver from 'react-observer-component';

const MyComponent = () => {
    const [isInView, ref] = useObserver();

    return (
        <div ref={ref}>
            {isInView && <p>Only shows when is in viewport!</p>}
        </div>
    );
};

Browser support

Author: Mikel Parra mikelpmc@gmail.com | http://github.com/mikelpmc
1.0.6

4 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago