A collection of React Hook recipes.
Recipe | Description |
---|---|
useDebounce | A hook for debouncing the updates of a value, only using the trailing update. |
useDrag | A hook to make dragging elements easier. |
useKeypress | A hook to detect when the specific keys are pressed. |
useThrottle | A hook for throttling the updates of a value. |
HookBook is supported in projects that are using the latest versions of React (16.8.0+). To install, run the following command from your CLI.
$ npm install hook-book
import useKeyPress from 'hook-book/use-keypress'
const Component = () => {
const keysPressed = useKeyPress()
return (...)
}