# @fenderdigital/react-intersection-observer

> Fender React UI Kit IntersectionObserver Hook

Latest version **0.2.1** (published 2019-08-22) · UNLICENSED license · 0 weekly downloads

## Install

```sh
npm install @fenderdigital/react-intersection-observer
pnpm add @fenderdigital/react-intersection-observer
yarn add @fenderdigital/react-intersection-observer
bun add @fenderdigital/react-intersection-observer
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2019-08-22 |
| First published | 2019-08-13 |
| Weekly downloads | 0 |
| License | UNLICENSED |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Fender Digital |
| Maintainers | jemnon, philipyun, theloopla |
| Keywords | react, css, library, components, interface, functional, OOCSS, declarative, ui, user, ux |

## Links

- npm: https://www.npmjs.com/package/@fenderdigital/react-intersection-observer
- npm.io page: https://npm.io/package/@fenderdigital/react-intersection-observer

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 0.2.1 (latest) — 2019-08-22
- 0.2.0 — 2019-08-13
- 0.1.1 — 2019-08-13
- 0.1.0 — 2019-08-13

## README

# IntersectionObserver for Fender React UI Kit

### Description

A custom react hook for the intersection observer.

### Installation and Usage

```
yarn add @fenderdigital/react-intersection-observer --save
```

```js
import React, { useEffect, useRef } from 'react';
import useIntersectionObserver from '@fenderdigital/react-intersection-observer';

const MyComponent = () => {
  const target = useRef();
  const options = {
    root: null,
    rootMargin: '0px',
    threshold: 0.5,
  };
  const [hasIntersected] = useIntersectionObserver(options, target);
  useEffect(
    () => {
      if (hasIntersected) {
        // do something cool
      }
    },
    [hasIntersected],
  );
  return <img ref={target} src="/foo.jpg" />;
};
```

### Development

Check the [Monorepo README](https://github.com/fenderdigital/react-ui-kit) for development documentation.

---
_Source: https://npm.io/package/@fenderdigital/react-intersection-observer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
