1.0.1 • Published 5 years ago
@customhooks/use-hover v1.0.1
@customhooks/use-hover
React Hook to detect a hover on an any React element.
Installaction
npm install @customhooks/use-hover
or
yarn add @customhooks/use-hover
Usage
useHover()
have a one argument like this :useHover(onHover)
onHover
is must be function.
import React from "react";
import useHover from "@customhooks/use-hover";
function App() {
const onHover = () => console.log("Hello World!");
const el = useClick(onHover);
return <h1 ref={el}>Hello World!</h1>;
}