README
react-helpers-og
Some useful hooks and utils for React
Getting started
Install package via npm:
npm install --save react-helpers-og
Usage
import { useRect, merge } from 'react-helpers-og';
...or you can directly import what you need:
import useRect from 'react-helpers-og/src/hooks/useRect';
import merge from 'react-helpers-og/src/utils/merge';
Documentation
Hooks
- useClickState to provide
clicked
logic - useDoubleClick to provide
doubleclick
logic - useEvent to listen events
- useHoverState to provide
hovered
logic - useKeyDown to listen
keydown
events - useMethod to return memoized
function
- useOutsideClick to provide
outsideclick
logic - useOverflow to observe node
overflow
- usePropsRef to return
ref
withcurrent
prop - useRect to observe node
rect
- useRecursiveAnimationFrame to start recursive
requestAnimationFrame
- useTooltip hook to return tooltip
coords
License
react-helpers-og is available under the MIT License.