@morizkay/use-in-view
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

useInView with support for Typescript

Check out a working demo here

Install

$ yarn add @morizkay/use-in-view

Usage

import useInView from 'use-in-view';

const AnimatedComponent = () => {
	const offset = 30;
	const [ref, inView] = useInView(offset);

	return (
		<div className={`${inView && 'in-view'}`} ref={ref}>
			Animate me!
		</div>
	);
};

Readme

Keywords

none

Package Sidebar

Install

npm i @morizkay/use-in-view

Weekly Downloads

1

Version

0.1.3

License

MIT

Unpacked Size

11.4 kB

Total Files

10

Last publish

Collaborators

  • morizkay