use-appear
v0.1.2
Published
⚛️React useAppear hook.
Downloads
23
Maintainers
Readme
useAppear
⚛️React useAppear hook.
(Created by create-n.)
Install
yarn add use-appear
Usage
import * as React from 'react';
import useAppear from 'use-appear';
export default function AppearElement() {
const [ref] = useAppear(function() {
console.log('appear');
return function() {
console.log('disappear');
};
});
return (
<div ref={ref}>Element</div>
);
}