@nikitababko/react-custom-hooks
v1.3.2
Published
Custom react hooks
Downloads
5
Maintainers
Readme
React custom hooks
Install
npm install @nikitababko/react-custom-hooks
or
yarn add @nikitababko/react-custom-hooks
Description
useInput
Managed component logic.
useHover
Hover effect.
useScroll(useInfinitePagination)
For example, we parse a list of tasks. Hundreds of tasks are loaded to us at once. But we don't want this behavior, we want to do dynamic pagination. That is, we scroll through, reach the end and the next batch is loaded for us.
useDebounce
We write something in the "input" field and a search request is sent to us - "give me a task with such and such a name". And we want this request to be sent not when the button is clicked, but the moment we enter something.
P.S.There are a lot of options for using such a hook. It doesn't have to be "input". For example, we want to track when the user stops moving the mouse. or something like that.
useRequest
Request logic.
useModal
Pop-up window
useValidation
Form validation
useFocus
Focus on element