@jgordy24/react-hooks-lib
"A package of commonly used react hooks"
Install
npm install --save @jgordy24/react-hooks-lib
Usage
useHover
import React from 'react';
import { useHover } from '@jgordy24/react-hooks-lib';
const App = () => {
const [hoverRef, isHovered] = useHover();
return (
<div>
<button
ref={hoverRef}
style={{
backgroundColor: isHovered ? '#424242' : '#121212',
color: '#FFF',
}}
>
My Button
</button>
</div>
)
}
more examples coming soon
License
MIT © JGordy
This hook is created using create-react-hook.