1.0.0-hotfix-2 • Published 4 years ago

react-intersection-observer-hooks v1.0.0-hotfix-2

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

use-intersection-observer

easy to use hook for intersection observers

NPM JavaScript Style Guide

Install

npm i use-intersection-observer

Usage

import * as React from "react";

import { useIntersectionObserver } from "use-intersection-observer";

const Example = () => {
	const { observe } = useIntersectionObserver(entries => {
		for (const entry of entries) {
			// do stuff with each entry
		}
	});

	return (
		<div>
			<ul>
				<li ref={observe}></li>
				<li ref={observe}></li>
				<li ref={observe}></li>
			</ul>
		</div>
	);
};

License

MIT © GypsyDangerous


This hook is created using create-react-hook.