use-appear
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

useAppear

Build Status NPM Version NPM Downloads MIT License Standard Version Codecov

⚛️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>
  );
}

Package Sidebar

Install

npm i use-appear

Weekly Downloads

3

Version

0.1.2

License

MIT

Unpacked Size

506 kB

Total Files

24

Last publish

Collaborators

  • vivaxy